word-stream
Advanced tools
+6
-5
@@ -1,6 +0,7 @@ | ||
| 'use strict'; | ||
| const fs = require('fs'); | ||
| const binarySlit = require('binary-split'); | ||
| const wordListPath = require('word-list'); | ||
| import fs from 'node:fs'; | ||
| import binarySlit from 'binary-split'; | ||
| import wordListPath from 'word-list'; | ||
| module.exports = fs.createReadStream(wordListPath).pipe(binarySlit()); | ||
| export default function wordStream() { | ||
| return fs.createReadStream(wordListPath).pipe(binarySlit()); | ||
| } |
+42
-37
| { | ||
| "name": "word-stream", | ||
| "version": "2.0.0", | ||
| "description": "Returns a stream of English words", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/word-stream", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=4" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "word", | ||
| "words", | ||
| "stream", | ||
| "list", | ||
| "en", | ||
| "english", | ||
| "dict", | ||
| "dictionary" | ||
| ], | ||
| "dependencies": { | ||
| "binary-split": "^1.0.3", | ||
| "word-list": "^2.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "*", | ||
| "xo": "*" | ||
| } | ||
| "name": "word-stream", | ||
| "version": "3.0.0", | ||
| "description": "Returns a stream of English words", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/word-stream", | ||
| "funding": "https://github.com/sponsors/sindresorhus", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "https://sindresorhus.com" | ||
| }, | ||
| "type": "module", | ||
| "exports": "./index.js", | ||
| "sideEffects": false, | ||
| "engines": { | ||
| "node": ">=18" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "word", | ||
| "words", | ||
| "stream", | ||
| "list", | ||
| "en", | ||
| "english", | ||
| "dict", | ||
| "dictionary" | ||
| ], | ||
| "dependencies": { | ||
| "binary-split": "^1.0.5", | ||
| "word-list": "^4.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "^6.1.2", | ||
| "p-event": "^6.0.1", | ||
| "xo": "^0.58.0" | ||
| } | ||
| } |
+9
-19
@@ -1,2 +0,2 @@ | ||
| # word-stream [](https://travis-ci.org/sindresorhus/word-stream) | ||
| # word-stream | ||
@@ -7,16 +7,14 @@ > Returns a stream of English words from the [Letterpress Word List](https://github.com/atebits/Words/blob/master/Words/en.txt) | ||
| ## Install | ||
| ```sh | ||
| npm install word-stream | ||
| ``` | ||
| $ npm install --save word-stream | ||
| ``` | ||
| ## Usage | ||
| ```js | ||
| const wordStream = require('word-stream'); | ||
| import wordStream from 'word-stream'; | ||
| wordStream.on('data', word => { | ||
| wordStream().on('data', word => { | ||
| console.log(word); | ||
@@ -30,3 +28,2 @@ }); | ||
| ## Tip | ||
@@ -37,14 +34,7 @@ | ||
| ```js | ||
| const getStream = require('get-stream'); | ||
| const wordStream = require('word-stream'); | ||
| import wordStream from 'word-stream'; | ||
| import {getStreamAsArray} from 'get-stream'; | ||
| getStream.array(wordStream).then(words => | ||
| console.log(words); | ||
| //=> […, 'abmhos', 'abnegate', …] | ||
| }); | ||
| console.log(await getStreamAsArray(wordStream())); | ||
| //=> […, 'abmhos', 'abnegate', …] | ||
| ``` | ||
| ## License | ||
| MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6
20%1
-50%Yes
NaN2826
-3.68%3
50%38
-20.83%+ Added
- Removed
Updated
Updated