js-tokens
A regex that tokenizes JavaScript.
Last updated 7 years ago by lydell .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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

  • 8.0.2                                ...           latest (a year ago)

21 Versions

  • 8.0.2                                ...           a year ago
  • 8.0.1                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.0                                ...           4 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           7 years ago
  • 3.0.2                                ...           7 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
  • 0.4.1                                ...           10 years ago
  • 0.4.0                                ...           10 years ago
  • 0.3.1                                ...           10 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |