Skip to content

Commit d6aec17

Browse files
committed
Init
0 parents  commit d6aec17

10 files changed

+129
-0
lines changed

Diff for: .editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.yml]
11+
indent_style = space
12+
indent_size = 2

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
yarn.lock

Diff for: .npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

Diff for: .travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- '12'
4+
- '10'

Diff for: cli.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
const {promisify} = require('util');
4+
const stream = require('stream');
5+
const meow = require('meow');
6+
const {readableNoopStream, writableNoopStream} = require('noop-stream');
7+
8+
const streamPipeline = promisify(stream.pipeline);
9+
10+
meow(`
11+
Examples
12+
$ dev-null | cat
13+
$ echo '🦄' | dev-null
14+
`);
15+
16+
(async () => {
17+
if (process.stdin.isTTY) {
18+
await streamPipeline(readableNoopStream(), process.stdout);
19+
} else {
20+
await streamPipeline(process.stdin, writableNoopStream());
21+
}
22+
})();

Diff for: license

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: package.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "dev-null-cli",
3+
"version": "0.0.0",
4+
"description": "Cross-platform `/dev/null`",
5+
"license": "MIT",
6+
"repository": "sindresorhus/dev-null-cli",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "[email protected]",
10+
"url": "sindresorhus.com"
11+
},
12+
"bin": {
13+
"dev-null": "cli.js"
14+
},
15+
"engines": {
16+
"node": ">=10"
17+
},
18+
"scripts": {
19+
"test": "xo && ava"
20+
},
21+
"files": [
22+
"cli.js"
23+
],
24+
"keywords": [
25+
"cli-app",
26+
"cli",
27+
"dev",
28+
"null",
29+
"devnull",
30+
"stream",
31+
"pipe",
32+
"ignore",
33+
"silence",
34+
"noop"
35+
],
36+
"dependencies": {
37+
"meow": "^5.0.0",
38+
"noop-stream": "^0.1.0"
39+
},
40+
"devDependencies": {
41+
"ava": "^1.4.1",
42+
"execa": "^1.0.0",
43+
"xo": "^0.24.0"
44+
}
45+
}

Diff for: readme.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# dev-null-cli [![Build Status](https://travis-ci.com/sindresorhus/dev-null-cli.svg?branch=master)](https://travis-ci.com/sindresorhus/dev-null-cli)
2+
3+
> Cross-platform [`/dev/null`](https://en.wikipedia.org/wiki/Null_device)
4+
5+
6+
## Install
7+
8+
```
9+
$ npm install --global dev-null-cli
10+
```
11+
12+
13+
## Usage
14+
15+
```
16+
$ dev-null-cli --help
17+
18+
Examples
19+
$ dev-null | cat
20+
$ echo '🦄' | dev-null
21+
```
22+
23+
24+
## Related
25+
26+
- [noop-stream](https://github.com/sindresorhus/noop-stream) - Readable Node.js stream that produces no data or a writable stream that discards data

Diff for: test.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import test from 'ava';
2+
import execa from 'execa';
3+
4+
test('main', async t => {
5+
const {stdout} = await execa('./cli.js', {input: '🦄'});
6+
t.is(stdout, '');
7+
});

0 commit comments

Comments
 (0)