@trenskow/atomic-write-stream 0.1.0 → 0.1.2

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/eslint.config.js CHANGED
@@ -38,6 +38,7 @@ export default [...compat.extends('eslint:recommended'), {
38
38
 
39
39
  'no-unused-vars': ['error', {
40
40
  argsIgnorePattern: '^_',
41
+ caughtErrors: 'none'
41
42
  }],
42
43
 
43
44
  'no-empty': ['error', {
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // index.js
3
- // @trenskow/signed-stream
3
+ // @trenskow/atomic-write-stream
4
4
  //
5
5
  // Created by Kristian Trenskow on 2025/01/01
6
6
  // See license in LICENSE.
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // index.js
3
- // @trenskow/signed-stream
3
+ // @trenskow/atomic-write-stream
4
4
  //
5
5
  // Created by Kristian Trenskow on 2025/01/01
6
6
  // See license in LICENSE.
@@ -11,9 +11,9 @@ import { rename, unlink, stat } from 'fs/promises';
11
11
  import { tmpdir } from 'os';
12
12
  import { basename } from 'path';
13
13
  import { randomBytes } from 'crypto';
14
- import { Transform } from 'stream';
14
+ import { PassThrough } from 'stream';
15
15
 
16
- class AtomicStream extends Transform {
16
+ class AtomicStream extends PassThrough {
17
17
 
18
18
  constructor(path, { tmpDirectory = tmpdir() } = {}) {
19
19
 
@@ -80,7 +80,7 @@ class AtomicStream extends Transform {
80
80
 
81
81
  };
82
82
 
83
- export default createAtomicWriteStream = (path, { tmpDirectory = tmpdir() } = {}) => {
83
+ export default (path, { tmpDirectory = tmpdir() } = {}) => {
84
84
 
85
85
  const writeStream = createWriteStream(path);
86
86
  const atomicStream = new AtomicStream(path, { tmpDirectory });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@trenskow/atomic-write-stream",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A writeable file stream that writes atomically.",
5
5
  "main": "index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1"
8
9
  },