Skip to content

Commit

Permalink
Require Node.js 12 and move to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 16, 2021
1 parent 7477015 commit 36620ad
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 82 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
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ jobs:
node-version:
- 14
- 12
- 10
- 8
- 6
- 4
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
11 changes: 6 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const stripAnsi = require('strip-ansi');
import meow from 'meow';
import stripAnsi from 'strip-ansi';
import getStdin from 'get-stdin';

const cli = meow(`
Usage
Expand All @@ -26,6 +26,7 @@ if (!input && process.stdin.isTTY) {
if (input) {
init(input);
} else {
process.stdin.setEncoding('utf8');
process.stdin.on('data', init);
(async () => {
init(await getStdin());
})();
}
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
117 changes: 60 additions & 57 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,62 @@
{
"name": "strip-ansi-cli",
"version": "2.0.0",
"description": "Strip ANSI escape codes",
"license": "MIT",
"repository": "chalk/strip-ansi-cli",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bin": {
"strip-ansi": "cli.js"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"cli.js"
],
"keywords": [
"cli-app",
"cli",
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"meow": "^3.7.0",
"strip-ansi": "^4.0.0"
},
"devDependencies": {
"ava": "*",
"execa": "^0.7.0",
"xo": "*"
}
"name": "strip-ansi-cli",
"version": "2.0.0",
"description": "Strip ANSI escape codes",
"license": "MIT",
"repository": "chalk/strip-ansi-cli",
"funding": "https://github.com/chalk/strip-ansi-cli?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"strip-ansi": "./cli.js"
},
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"cli.js"
],
"keywords": [
"cli-app",
"cli",
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"get-stdin": "^9.0.0",
"meow": "^9.0.0",
"strip-ansi": "^7.0.0"
},
"devDependencies": {
"ava": "^3.15.0",
"execa": "^5.0.0",
"xo": "^0.38.2"
}
}
9 changes: 0 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)

## Install

```
$ npm install --global strip-ansi-cli
```


## Usage

```
Expand All @@ -23,18 +21,11 @@ $ strip-ansi --help
$ ls --color | strip-ansi
```


## Related

- [strip-ansi](https://github.com/chalk/strip-ansi) - API for this module


## Maintainers

- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)


## License

MIT
5 changes: 2 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
const test = require('ava');
const execa = require('execa');
import test from 'ava';
import execa from 'execa';

test('main', async t => {
const {stdout} = await execa('./cli.js', ['--version']);
Expand Down

0 comments on commit 36620ad

Please sign in to comment.