
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
libcore-tokenizer
Advanced tools
NFA Tokenizer
Tokenizer can be installed from NPM by running the lines below in your working directory containing package.json file for use in NodeJS, browserify or webpack.
npm install libcore-tokenizer --save
The following lines defines tokens and regular expressions and uses the tokenizer instance to tokenize the string.
var Tokenizer = require("libcore-tokenizer"),
tokenizer = new Tokenizer(),
subject = "12345abc67890";
// declare tokens
tokenizer.define([
"number", /[0-9]+/,
"sequence", /a-c]+/,
/[d-z]+/,
/[A-Z]+/
]);
// tokenize (indexFrom, stringSubject)
tokenizer.tokenize(0, subject);
// result:
// ["number", "12345", 5]
tokenizer.tokenize(5, subject);
// result: ["sequence", "abc", 8]
tokenizer.tokenize(8, subject);
// result: ["number", "67890", 13]
tokenizer.tokenize(13, subject);
// result: ["$", "", 14] -- end token, next call on next index would result in null
tokenizer.tokenize(14, subject);
// result: null
You can also export state matrix of the state machine to JSON string by running the lines below.
var Tokenizer = require("libcore-tokenizer"),
tokenizer = new Tokenizer();
// declare tokens
tokenizer.define([
"number", /[0-9]+/,
"sequence", /a-c]+/,
/[d-z]+/,
/[A-Z]+/
]);
console.log(tokenizer.toJSON());
// result: JSON string containing state matrix object
You can import state matrix from JSON string or from Native Object.
var Tokenizer = require("libcore-tokenizer"),
exportedJSON = require("./tokenizer-matrix.json"),
tokenizer = new Tokenizer();
tokenizer.fromJSON(exportedJSON());
// torkenizer is now ready for tokenizing string
| operator? operator+ operator* operator[], and Negated Character Class [^] operators. Character Ranges like 0-9a-z is also supported.() operator (Capture is not yet implemented)FAQs
NFA Tokenizer
We found that libcore-tokenizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.