Skip to content

Commit

Permalink
Require Node.js 12.20
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 17, 2021
1 parent cdfd4d8 commit 1e74bbb
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 32 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
8 changes: 2 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ jobs:
fail-fast: false
matrix:
node-version:
- 14
- 12
- 10
- 8
- 6
- 16
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
14 changes: 8 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node
'use strict';
const fs = require('fs');
const {spawn} = require('child_process');
const meow = require('meow');
const tempy = require('tempy');
import process from 'node:process';
import fs from 'node:fs';
import {spawn} from 'node:child_process';
import meow from 'meow';
import tempy from 'tempy';

const file = tempy.file();
const argv = process.argv.slice(2);
Expand All @@ -16,7 +16,9 @@ meow(`
git diff | tmpin atom
Note that the first arguments to <app> will be set to the temp file
`);
`, {
importMeta: import.meta,
});

process.stdin.pipe(fs.createWriteStream(file));

Expand Down
4 changes: 2 additions & 2 deletions fixture.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
'use strict';
const fs = require('fs');
import process from 'node:process';
import fs from 'node:fs';

process.stdout.write(fs.readFileSync(process.argv[2], 'utf8'));
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)

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:

Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"description": "Add stdin support to any CLI app that accepts file input",
"license": "MIT",
"repository": "sindresorhus/tmpin",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": "cli.js",
"engines": {
"node": ">=6"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -35,12 +37,12 @@
"substitution"
],
"dependencies": {
"meow": "^4.0.0",
"tempy": "^0.2.1"
"meow": "^10.1.1",
"tempy": "^1.0.1"
},
"devDependencies": {
"ava": "*",
"execa": "^0.10.0",
"xo": "*"
"ava": "^3.15.0",
"execa": "^5.1.1",
"xo": "^0.44.0"
}
}
8 changes: 0 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ It pipes stdin to a temp file and spawns the chosen app with the temp file path

Similar to [process substitution](https://en.wikipedia.org/wiki/Process_substitution) in ZSH/Bash, but cross-platform and without its [limitation](https://en.wikipedia.org/wiki/Process_substitution#Limitations).


## Install

```
$ npm install --global tmpin
```


## Usage

```
Expand All @@ -28,7 +26,6 @@ $ tmpin --help
Note that the first argument to <app> will be set to the temp file
```


## Tip

Create an alias in your `.zshrc`/`.bashrc`:
Expand All @@ -39,8 +36,3 @@ alias atom='tmpin atom'
# Or more specific
alias gda='git diff | tmpin atom'
```


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

0 comments on commit 1e74bbb

Please sign in to comment.