Skip to content

Commit

Permalink
Require Node.js 8, add TypeScript definition (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
BendingBender authored and sindresorhus committed Apr 18, 2019
1 parent 99ff32a commit 4682ea9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
3 changes: 3 additions & 0 deletions binary-extensions.json.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const binaryExtensionsJson: readonly string[];

export = binaryExtensionsJson;
14 changes: 14 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
List of binary file extensions.
@example
```
import binaryExtensions = require('binary-extensions');
console.log(binaryExtensions);
//=> ['3ds', '3g2', …]
```
*/
declare const binaryExtensions: readonly string[];

export = binaryExtensions;
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./binary-extensions.json');
6 changes: 6 additions & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {expectType} from 'tsd';
import binaryExtensions = require('.');
import binaryExtensionsJson = require('./binary-extensions.json');

expectType<readonly string[]>(binaryExtensions);
expectType<readonly string[]>(binaryExtensionsJson);
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
"node": ">=8"
},
"scripts": {
"test": "ava"
"test": "xo && ava && tsd"
},
"main": "binary-extensions.json",
"files": [
"binary-extensions.json"
"index.js",
"index.d.ts",
"binary-extensions.json",
"binary-extensions.json.d.ts"
],
"keywords": [
"bin",
Expand All @@ -31,6 +33,8 @@
"array"
],
"devDependencies": {
"ava": "0.16.0"
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

0 comments on commit 4682ea9

Please sign in to comment.