Is there a JavaScript code analyzer that can be used on the client side to parse code patterns? I found the following, but it seems that it is only for plain text and gives a = sign, etc. I need an analysis of the code that can be executed on the client side (JS code), is there any that can be used?
function parseData() { var rawData = document.getElementById('data').value.trim(), result, output = $('#output'), table = $('table').remove(), header, row, cell, ul, slice, wpm = [], wpmAvg = []; output.empty(); table.find('thead, tbody').empty(); if ($('[name="format"]:checked').val() === 'text') {
body { font-family: arial; } table, tr, td, th { border-collapse: collapse; border: solid 1px #ddd; } th, td { padding: 4px 8px; } .subText { color:#999; font-style: italic; } #wpm { width:600px; height: 400px; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.js"></script> <textarea id="data" cols="80" rows="20" placeholder="Paste text or JSON here"></textarea><br /> <label for="text"><input type="radio" name="format" checked value="text" id="text"> Simple text</label> <button type="button" onclick="parseData()">Analyze text</button> <br><br> <div id="output"></div><br><br> <div id="wpm"></div> <table> <thead> </thead> <tbody> </tbody> </table>
https://jsfiddle.net/fxn5q8y0/6/
user4209821
source share