Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

js-tokens

6.0.0 • Public • Published

js-tokens

The tiny, regex powered, lenient, almost spec-compliant JavaScript tokenizer that never fails.

const jsTokens = require("js-tokens");
 
const jsString = 'JSON.stringify({k:3.14**2}, null /*replacer*/, "\\t")';
 
Array.from(jsTokens(jsString), (token) => token.value).join("|");
// JSON|.|stringify|(|{|k|:|3.14|**|2|}|,| |null| |/*replacer*/|,| |"\t"|)

➡️ Full readme

Install

npm i js-tokens

DownloadsWeekly Downloads

35,005,650

Version

6.0.0

License

MIT

Unpacked Size

15.5 kB

Total Files

5

Last publish

Collaborators

  • avatar