async-file-tried 1.0.1 → 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.
@@ -4,7 +4,7 @@ on:
4
4
  pull_request:
5
5
  push:
6
6
  branches:
7
- - main # Adjust the branch name based on your default branch
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: Upload coverage to Codecov
24
- uses: codecov/codecov-action@v2
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.FS_TOKEN }}
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, more concise code by getting a smoothed response. TypeScript supported.
4
+ Write more linear, better readable code by getting a concise response. TypeScript supported.
5
+
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ ![Node.js Version](https://img.shields.io/badge/Node.js-16.x-green)
8
+ [![Build](https://github.com/fwalzel/async-file-tried/actions/workflows/node.js.yml/badge.svg)](https://github.com/fwalzel/async-file-tried/actions/workflows/node.js.yml/badge.svg)
9
+ [![Coverage Status](https://coveralls.io/repos/github/fwalzel/async-file-tried/badge.svg?branch=main)](https://coveralls.io/github/fwalzel/async-file-tried?branch=main)
10
+ [![Known Vulnerabilities](https://snyk.io/test/github/fwalzel/async-file-tried/badge.svg)](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,13 +1,14 @@
1
1
  {
2
2
  "name": "async-file-tried",
3
- "version": "1.0.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-report/lcov.info"
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",
@@ -21,24 +22,9 @@
21
22
  "homepage": "https://github.com/fwalzel/async-file-tried#readme",
22
23
  "devDependencies": {
23
24
  "@types/node": "^20.9.5",
25
+ "c8": "^8.0.1",
24
26
  "chai": "^4.3.6",
25
- "mocha": "^10.1.0",
26
- "test-console": "^2.0.0"
27
- },
28
- "nyc": {
29
- "reporter": [
30
- "text",
31
- "lcov"
32
- ],
33
- "all": true,
34
- "include": [
35
- "dist/index.js"
36
- ],
37
- "exclude": [
38
- "node_modules/**",
39
- "test/*.test.js",
40
- "index.ts"
41
- ]
27
+ "mocha": "^10.1.0"
42
28
  },
43
29
  "keywords": [
44
30
  "fs promises",
@@ -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);