Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoubin/word-filter
Extract words from the input stream
https://github.com/zoubin/word-filter
Last synced: 8 days ago
JSON representation
Extract words from the input stream
- Host: GitHub
- URL: https://github.com/zoubin/word-filter
- Owner: zoubin
- License: mit
- Created: 2016-01-28T12:09:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-05T06:03:41.000Z (almost 9 years ago)
- Last Synced: 2024-10-13T20:16:00.339Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# word-filter
[![version](https://img.shields.io/npm/v/word-filter.svg)](https://www.npmjs.org/package/word-filter)
[![status](https://travis-ci.org/zoubin/word-filter.svg?branch=master)](https://travis-ci.org/zoubin/word-filter)Extract words from the input stream into another text stream.
[中文介绍](读我.md)
## Command line
```bash
npm i -g word-filterwf -h
wf -n example/text
cat example/text | wf -n```
## API
```js
const WordFilter = require('word-filter')const fs = require('fs')
fs.createReadStream(__dirname + '/text')
.pipe(WordFilter.ascii())
.on('data', word => console.log(word))```
**Input**
```
Don't repeat yourself.
笑相遇,似觉琼枝玉树相倚,暖日明霞光烂。
Do one thing and do it well.
在Node stream暴露的接口中,Readable和Writable分别需要实现_read和_write方法。```
**Output**
```
Don
t
repeat
yourself
Do
one
thing
and
do
it
well
Node
stream
Readable
Writable
_read
_write```