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 Nov 21, 2021
1 parent 5d1e241 commit 730557e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 27 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 14
- 12
- 10
- 8
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
23 changes: 12 additions & 11 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const sparkly = require('sparkly');
const getStdin = require('get-stdin');
import process from 'node:process';
import meow from 'meow';
import sparkly from 'sparkly';
import getStdin from 'get-stdin';

const cli = meow(`
Usage
Expand All @@ -24,20 +24,21 @@ const cli = meow(`
$ echo 0 3 5 8 4 3 | sparkly
▁▂▃▅▃▂
`, {
importMeta: import.meta,
input: {
type: 'number'
type: 'number',
},
flags: {
min: {
type: 'number'
type: 'number',
},
max: {
type: 'number'
type: 'number',
},
style: {
type: 'string'
}
}
type: 'string',
},
},
});

const {input} = cli;
Expand All @@ -51,7 +52,7 @@ if (input.length > 0) {
console.log(sparkly(input, cli.flags));
} else {
(async () => {
const data = (await getStdin()).match(/\d/g).map(x => parseInt(x, 10));
const data = (await getStdin()).match(/\d/g).map(x => Number.parseInt(x, 10));
console.log(sparkly(data, cli.flags));
})();
}
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 <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"description": "Generate sparklines `▁▂▃▅▂▇`",
"license": "MIT",
"repository": "sindresorhus/sparkly-cli",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"bin": {
"sparkly": "cli.js"
"sparkly": "./cli.js"
},
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -36,13 +38,13 @@
"ascii"
],
"dependencies": {
"get-stdin": "^6.0.0",
"meow": "^5.0.0",
"sparkly": "^4.0.0"
"get-stdin": "^9.0.0",
"meow": "^10.1.2",
"sparkly": "^6.0.0"
},
"devDependencies": {
"ava": "*",
"execa": "^0.10.0",
"xo": "*"
"ava": "^3.15.0",
"execa": "^6.0.0",
"xo": "^0.46.4"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

## Install

```
$ npm install --global sparkly-cli
```sh
npm install --global sparkly-cli
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import execa from 'execa';
import {execa} from 'execa';

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

0 comments on commit 730557e

Please sign in to comment.