@xhmikosr/bin-wrapper 5.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +12 -8
  2. package/package.json +11 -16
  3. package/readme.md +3 -3
package/index.js CHANGED
@@ -124,7 +124,7 @@ export default class BinWrapper {
124
124
  runCheck(cmd) {
125
125
  return binCheck(this.path(), cmd).then(works => {
126
126
  if (!works) {
127
- throw new Error(`The \`${this.path()}\` binary doesn't seem to work correctly`);
127
+ throw new Error(`The "${this.path()}" binary doesn't seem to work correctly`);
128
128
  }
129
129
 
130
130
  if (this.version()) {
@@ -140,7 +140,7 @@ export default class BinWrapper {
140
140
  */
141
141
  findExisting() {
142
142
  return fs.stat(this.path()).catch(error => {
143
- if (error && error.code === 'ENOENT') {
143
+ if (error?.code === 'ENOENT') {
144
144
  return this.download();
145
145
  }
146
146
 
@@ -165,11 +165,13 @@ export default class BinWrapper {
165
165
  urls.push(file.url);
166
166
  }
167
167
 
168
- return Promise.all(urls.map(url => download(url, this.dest(), {
169
- extract: true,
170
- strip: this.options.strip,
171
- }))).then(result => {
172
- const resultingFiles = result.flatMap((item, index) => {
168
+ return Promise.all(
169
+ urls.map(url => download(url, this.dest(), {
170
+ extract: true,
171
+ strip: this.options.strip,
172
+ })),
173
+ ).then(result => {
174
+ const resultFiles = result.flatMap((item, index) => {
173
175
  if (Array.isArray(item)) {
174
176
  return item.map(file => file.path);
175
177
  }
@@ -180,7 +182,9 @@ export default class BinWrapper {
180
182
  return parsedPath.base;
181
183
  });
182
184
 
183
- return Promise.all(resultingFiles.map(fileName => fs.chmod(path.join(this.dest(), fileName), 0o755)));
185
+ return Promise.all(
186
+ resultFiles.map(file => fs.chmod(path.join(this.dest(), file), 0o755)),
187
+ );
184
188
  });
185
189
  }
186
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xhmikosr/bin-wrapper",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "Binary wrapper that makes your programs seamlessly available as local dependencies",
5
5
  "license": "MIT",
6
6
  "repository": "XhmikosR/bin-wrapper",
@@ -13,13 +13,15 @@
13
13
  "url": "https://github.com/kevva"
14
14
  },
15
15
  "engines": {
16
- "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
16
+ "node": "^14.14.0 || >=16.0.0"
17
17
  },
18
18
  "scripts": {
19
19
  "ava": "ava",
20
+ "lint": "xo",
20
21
  "xo": "xo",
22
+ "fix": "xo --fix",
21
23
  "test": "npm run xo && npm run ava",
22
- "test-ci": "npm run xo && c8 ava"
24
+ "test-ci": "c8 ava"
23
25
  },
24
26
  "main": "index.js",
25
27
  "type": "module",
@@ -35,26 +37,19 @@
35
37
  "local",
36
38
  "wrapper"
37
39
  ],
38
- "c8": {
39
- "reporter": [
40
- "lcovonly",
41
- "text"
42
- ]
43
- },
44
40
  "dependencies": {
45
- "@xhmikosr/downloader": "^9.0.0",
41
+ "@xhmikosr/downloader": "^10.0.1",
46
42
  "bin-check": "^4.1.0",
47
43
  "bin-version-check": "^5.0.0",
48
44
  "os-filter-obj": "^2.0.0"
49
45
  },
50
46
  "devDependencies": {
51
- "ava": "^4.3.0",
52
- "c8": "^7.11.3",
47
+ "ava": "^5.3.0",
48
+ "c8": "^7.13.0",
53
49
  "executable": "^4.1.1",
54
- "nock": "^13.2.6",
50
+ "nock": "^13.3.1",
55
51
  "path-exists": "^5.0.0",
56
- "rimraf": "^3.0.2",
57
- "tempy": "^2.0.0",
58
- "xo": "^0.49.0"
52
+ "tempy": "^3.0.0",
53
+ "xo": "^0.54.2"
59
54
  }
60
55
  }
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # bin-wrapper [![CI](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml)
1
+ # bin-wrapper [![CI](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml)
2
2
 
3
3
  > Binary wrapper that makes your programs seamlessly available as local dependencies
4
4
 
@@ -6,7 +6,7 @@
6
6
  ## Install
7
7
 
8
8
  ```sh
9
- npm install bin-wrapper
9
+ npm install @xhmikosr/bin-wrapper
10
10
  ```
11
11
 
12
12
 
@@ -14,7 +14,7 @@ npm install bin-wrapper
14
14
 
15
15
  ```js
16
16
  import path from 'node:path';
17
- import BinWrapper from 'bin-wrapper';
17
+ import BinWrapper from '@xhmikosr/bin-wrapper';
18
18
 
19
19
  const base = 'https://github.com/imagemin/gifsicle-bin/raw/main/vendor';
20
20
  const bin = new BinWrapper()