8.2.3 • Published 6 months ago

fs-chain v8.2.3

Weekly downloads
24
License
MIT
Repository
github
Last release
6 months ago

fs-chain

A file I/O tool chain.

npm github node

Installation

npm install fs-chain --save-dev

Usage

const { Text, Json } = require('fs-chain');

new Text() // create file
  .onDone(() => 'text:sample')
  .output('./filename');

new Json() // copy file
  .source('./old-filename')
  .output('./new-filename');

new Text() // edit file
  .source('./filename')
  .onDone((data) => data.trim())
  .output();

new Json() // transfer file
  .source('./old-filename')
  .onDone((data) => data.value)
  .output('./new-filename');

new Json().source('~qss'); // require.resolve

new Text()
  .onFail(() => {
    // skip following step
    throw new Error('skip');
  })
  .onDone(() => {
    // other step
  });

new Text()
  .logger('testing 1') // √ testing 1
  .onDone(() => {
    throw new Error('fail');
  })
  .logger('testing 2'); // × testing 2

new Text(process.cwd()).source('./');
new Text(__dirname).source('./');
new Text(__filename).source('../');
new Text(import.meta.url).source('../');
8.2.3

6 months ago

8.2.2

11 months ago

8.2.1

2 years ago

8.2.0

2 years ago

8.1.2

2 years ago

8.1.1

3 years ago

8.1.0

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

5.3.0

3 years ago

6.0.0

3 years ago

7.0.0

3 years ago

7.1.0

3 years ago

5.2.1

3 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.2.2

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.7

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago

0.0.0

5 years ago