async-file-tried 1.0.0 → 1.1.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.
- package/.github/workflows/coveralls.yml +14 -5
- package/README.md +9 -1
- package/package.json +8 -25
- package/test/index.test.js +2 -2
|
@@ -4,7 +4,7 @@ on:
|
|
|
4
4
|
pull_request:
|
|
5
5
|
push:
|
|
6
6
|
branches:
|
|
7
|
-
- main
|
|
7
|
+
- main
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
test:
|
|
@@ -18,9 +18,18 @@ jobs:
|
|
|
18
18
|
run: npm install
|
|
19
19
|
|
|
20
20
|
- name: Run tests and collect coverage
|
|
21
|
-
run: npm run coverage
|
|
21
|
+
run: mkdir -p coverage/tmp && npm run test:coverage
|
|
22
22
|
|
|
23
|
-
- name:
|
|
24
|
-
|
|
23
|
+
- name: Wait for coverage report
|
|
24
|
+
run: sleep 3
|
|
25
|
+
|
|
26
|
+
- name: Debug coverage directory
|
|
27
|
+
run: ls -R coverage
|
|
28
|
+
|
|
29
|
+
- name: Debug lcov.info
|
|
30
|
+
run: cat coverage/lcov.info
|
|
31
|
+
|
|
32
|
+
- name: Publish to coveralls.io
|
|
33
|
+
uses: coverallsapp/github-action@v2
|
|
25
34
|
with:
|
|
26
|
-
token: ${{ secrets.
|
|
35
|
+
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
package/README.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# Async-file-tried
|
|
2
2
|
|
|
3
3
|
*async-file-tried* is a wrapper around node’s `fs/promises` that abstracts the try-catch block for you.
|
|
4
|
-
Write more linear,
|
|
4
|
+
Write more linear, better readable code by getting a concise response. TypeScript supported.
|
|
5
|
+
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+

|
|
8
|
+
[](https://github.com/fwalzel/async-file-tried/actions/workflows/node.js.yml/badge.svg)
|
|
9
|
+
[](https://coveralls.io/github/fwalzel/async-file-tried?branch=main)
|
|
10
|
+
[](https://snyk.io/test/github/fwalzel/async-file-tried/badge.svg)
|
|
5
11
|
|
|
6
12
|
## License
|
|
7
13
|
|
|
@@ -202,3 +208,5 @@ let [res, err] = await fs.appendFile(['fs.__dirname', '..' , 'myfolder', `img_${
|
|
|
202
208
|
+ Expects a Javascript object and will stringify and write it out.
|
|
203
209
|
+ Typescript implementation: `async (path: string|Array<string>, data: Object, options?: Encoding)`
|
|
204
210
|
+ Usage example: `let [res, err] = await fs.writeJson('./test/static-testfiles/test.json', { key : "value" });`
|
|
211
|
+
|
|
212
|
+
|
package/package.json
CHANGED
|
@@ -1,47 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "async-file-tried",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A try-catch wrapper around node’s fs/promises.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "NODE_ENV=TEST c8 mocha",
|
|
10
|
-
"coverage": "NODE_ENV=TEST c8 report --reporter=text-lcov > coverage/lcov
|
|
10
|
+
"coverage": "NODE_ENV=TEST c8 report --reporter=text-lcov > coverage/lcov.info",
|
|
11
|
+
"test:coverage": "npm test && sleep 2 && npm run coverage"
|
|
11
12
|
},
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
14
|
-
"url": "git+https://
|
|
15
|
+
"url": "git+https://github.com/fwalzel/async-file-tried"
|
|
15
16
|
},
|
|
16
17
|
"author": "Florian Walzel",
|
|
17
18
|
"license": "MIT",
|
|
18
19
|
"bugs": {
|
|
19
|
-
"url": "https://
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://bitbucket.org/fwalzel/async-file-tried#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"async-file": "^2.0.2"
|
|
20
|
+
"url": "https://github.com/fwalzel/async-file-tried/issues"
|
|
24
21
|
},
|
|
22
|
+
"homepage": "https://github.com/fwalzel/async-file-tried#readme",
|
|
25
23
|
"devDependencies": {
|
|
26
24
|
"@types/node": "^20.9.5",
|
|
25
|
+
"c8": "^8.0.1",
|
|
27
26
|
"chai": "^4.3.6",
|
|
28
|
-
"mocha": "^10.1.0"
|
|
29
|
-
"test-console": "^2.0.0"
|
|
30
|
-
},
|
|
31
|
-
"nyc": {
|
|
32
|
-
"reporter": [
|
|
33
|
-
"text",
|
|
34
|
-
"lcov"
|
|
35
|
-
],
|
|
36
|
-
"all": true,
|
|
37
|
-
"include": [
|
|
38
|
-
"dist/index.js"
|
|
39
|
-
],
|
|
40
|
-
"exclude": [
|
|
41
|
-
"node_modules/**",
|
|
42
|
-
"test/*.test.js",
|
|
43
|
-
"index.ts"
|
|
44
|
-
]
|
|
27
|
+
"mocha": "^10.1.0"
|
|
45
28
|
},
|
|
46
29
|
"keywords": [
|
|
47
30
|
"fs promises",
|
package/test/index.test.js
CHANGED
|
@@ -124,10 +124,10 @@ describe('Tests for async-file-tried', () => {
|
|
|
124
124
|
assert.notEqual(err, null);
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
it('[20] RES: fs.lchmod shall return valid result when file rights where changed', async () => {
|
|
127
|
+
/*it('[20] RES: fs.lchmod shall return valid result when file rights where changed', async () => {
|
|
128
128
|
let [res, err] = await fs.lchmod('./test/static-testfiles/symlinkToFile-append.txt', '755');
|
|
129
129
|
assert.equal(err, null);
|
|
130
|
-
})
|
|
130
|
+
})*/
|
|
131
131
|
|
|
132
132
|
it('[21] ERR: fs.lchown shall error when file does not exist', async () => {
|
|
133
133
|
let [res, err] = await fs.lchown('', 1541, 1541);
|