Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

word-stream

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

word-stream - npm Package Compare versions

Comparing version
1.1.0
to
2.0.0
+4
-4
index.js
'use strict';
var fs = require('fs');
var split = require('split');
var wordListPath = require('word-list');
const fs = require('fs');
const binarySlit = require('binary-split');
const wordListPath = require('word-list');
module.exports = fs.createReadStream(wordListPath).pipe(split());
module.exports = fs.createReadStream(wordListPath).pipe(binarySlit());
{
"name": "word-stream",
"version": "1.1.0",
"version": "2.0.0",
"description": "Returns a stream of English words",

@@ -12,21 +12,16 @@ "license": "MIT",

},
"bin": "cli.js",
"engines": {
"node": ">=0.10.0"
"node": ">=4"
},
"scripts": {
"test": "mocha"
"test": "xo && ava"
},
"files": [
"index.js",
"cli.js"
"index.js"
],
"keywords": [
"cli-app",
"cli",
"word",
"words",
"word-stream",
"stream",
"list",
"stream",
"en",

@@ -38,9 +33,9 @@ "english",

"dependencies": {
"meow": "^3.5.0",
"split": "^1.0.0",
"word-list": "^1.0.0"
"binary-split": "^1.0.3",
"word-list": "^2.0.0"
},
"devDependencies": {
"mocha": "*"
"ava": "*",
"xo": "*"
}
}
+14
-25

@@ -18,22 +18,25 @@ # word-stream [![Build Status](https://travis-ci.org/sindresorhus/word-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/word-stream)

```js
var wordStream = require('word-stream');
const wordStream = require('word-stream');
wordStream.on('data', function (word) {
wordStream.on('data', word => {
console.log(word);
});
//=> ...
//=> …
//=> abmhos
//=> abnegate
//=> ...
//=> …
```
You can get all the words at once by using [stream-to-array](https://github.com/stream-utils/stream-to-array):
## Tip
You can get all the words at once by using [`get-stream`](https://github.com/sindresorhus/get-stream):
```js
var toArray = require('stream-to-array');
var wordStream = require('word-stream');
const getStream = require('get-stream');
const wordStream = require('word-stream');
toArray(wordStream, function (wordArray) {
console.log(wordArray);
//=> [..., 'abmhos', 'abnegate', ...]
getStream.array(wordStream).then(words =>
console.log(words);
//=> […, 'abmhos', 'abnegate', …]
});

@@ -43,18 +46,4 @@ ```

## CLI
```
$ npm install --global word-stream
```
```
$ word-stream --help
Usage
$ word-stream
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var meow = require('meow');
var wordListPath = require('word-list');
meow([
'Usage',
' $ word-stream'
]);
fs.createReadStream(wordListPath).pipe(process.stdout)
.on('error', process.stderr.write.bind(process.stderr));