Ngraminator is a lightweight JavaScript utility designed to generate ngrams from arrays of words. It supports various module environments, including Node.js (CommonJS and ES Modules) and browsers (UMD), making it versatile for both backend and frontend text processing tasks. The current stable version is 3.0.2. The package underwent a significant architectural change in v3.0.1, migrating from webpack to Rollup for bundling, which introduced breaking changes in how the library is imported via CommonJS and accessed globally in UMD environments. Its primary differentiator is its small footprint and broad environment compatibility for generating n-grams of specified lengths from input arrays, without additional complex dependencies. It maintains a moderate release cadence, with recent updates focusing on build system improvements and module compatibility.
npm install ngraminatorVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import `ngraminator` and generate various n-gram lengths from a string.
Update your CommonJS import statements to `const { ngraminator } = require('ngraminator')`.Access the function via `ngrm.ngraminator()` instead of `ngraminator()` in your browser scripts.
Review your existing build processes if they interact with `ngraminator`'s internals or expect specific bundle structures (e.g., source maps, tree-shaking behavior).
Upgrade to `npm install ngraminator@latest` or specifically `npm install ngraminator@^2.0.3` for v2.x series.
Change your import from `const ngraminator = require('ngraminator')` to `const { ngraminator } = require('ngraminator')`.Access the function via the `ngrm` global object: `ngrm.ngraminator(...)`.
No dependency data recorded yet.