js-tokens
Tiny JavaScript tokenizer.
Last updated 3 months ago by lydell .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install js-tokens 
SYNC missed versions from official npm registry.

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

Current Tags

  • 6.0.0                                ...           latest (3 months ago)

17 Versions

  • 6.0.0                                ...           3 months ago
  • 5.0.0                                ...           a year ago
  • 4.0.0                                ...           2 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.1                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 5,170
This Week 316,080
This Month 515,671
Last Day 23,739
Last Week 312,105
Last Month 1,306,948
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (146)

Copyright 2014 - 2016 © taobao.org |