Wondering what’s next for npm?Check out our public roadmap! »

    js-tokens
    TypeScript icon, indicating that this package has built-in type declarations

    7.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

    22,288,076

    Version

    7.0.0

    License

    MIT

    Unpacked Size

    15.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar