Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

js-tokens

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Issues
File Explorer

Advanced tools

js-tokens

Tiny JavaScript tokenizer.

    8.0.1latest
    Github

Version published
Maintainers
1
Weekly downloads
37,825,324
increased by1.36%

Weekly downloads

Changelog

Source

Version 8.0.1 (2023-01-16)

  • Fixed: /]/ is now parsed as a RegularExpressionLiteral. That’s invalid regex syntax, unless [Annex B: Additional ECMAScript Features for Web Browsers][annexb] is honored, which js-tokens does. Thanks to Jared Hughes (@jared-hughes) for reporting and fixing!

Readme

Source

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

Keywords

FAQs

What is js-tokens?

Tiny JavaScript tokenizer.

Is js-tokens popular?

The npm package js-tokens receives a total of 35,871,161 weekly downloads. As such, js-tokens popularity was classified as popular.

Is js-tokens well maintained?

We found that js-tokens demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 16 Jan 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc