8.2.0-next.1699877194.e0d337f448cfbbbb74a4669c5fcc993b08ec6c15 • Published 2 years ago

safefs v8.2.0-next.1699877194.e0d337f448cfbbbb74a4669c5fcc993b08ec6c15

Weekly downloads
295,374
License
Artistic-2.0
Repository
github
Last release
2 years ago

Stop getting EMFILE errors! Open only as many files as the operating system supports.

Usage

Complete API Documentation.

var safefs = require('safefs')

SafeFS uses graceful-fs to wrap all of the standard file system methods to avoid EMFILE errors among other problems.

On-top of graceful-fs, SafeFS also adds additional wrapping on the following methods:

  • writeFile(path, data, options?, next) - ensure the full path exists before writing to it
  • appendFile(path, data, options?, next) - ensure the full path exists before writing to it
  • mkdir(path, mode?, next) - mode defaults to 0o777 & (~process.umask())
  • unlink(path, next) - checks if the file exists before removing it

SafeFS also define these additional methods:

  • ensurePath(path, options, next) - ensure the full path exists, equivalent to unix's mdir -p path
  • getParentPathSync(path) - returns the parent directory of the path

If you want promises and a non-conflicting API, use @bevry/file.

npm

This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5 or thereabouts. You can accomlish this via your tsconfig.json file like so:

{
  "compilerOptions": {
    "maxNodeModuleJsDepth": 5
  }
}

Discover the release history by heading on over to the HISTORY.md file.

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

These amazing people are maintaining this project:

No sponsors yet! Will you be the first?

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Unless stated otherwise all works are:

and licensed under:

8.10.0

2 years ago

8.8.0

2 years ago

8.9.0

2 years ago

8.7.0

2 years ago

8.6.0

2 years ago

8.1.0

2 years ago

8.2.0

2 years ago

8.4.0

2 years ago

8.3.0

2 years ago

8.5.0

2 years ago

8.0.0

2 years ago

6.16.0

4 years ago

6.15.0

4 years ago

6.14.0

5 years ago

6.13.0

5 years ago

6.12.0

5 years ago

6.11.0

5 years ago

6.10.0

5 years ago

6.9.0

5 years ago

6.8.0

5 years ago

6.7.0

6 years ago

6.6.0

6 years ago

6.5.0

6 years ago

6.4.0

6 years ago

6.3.0

6 years ago

6.2.0

6 years ago

6.1.0

6 years ago

6.0.0

6 years ago

5.5.0

6 years ago

5.4.0

6 years ago

5.3.0

6 years ago

5.2.0

6 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.2.0

6 years ago

4.1.0

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.2.2

10 years ago

3.2.1

10 years ago

3.2.0

10 years ago

3.1.3

11 years ago

3.1.2

11 years ago

3.1.1

12 years ago

3.1.0

12 years ago

3.0.6

12 years ago

3.0.5

12 years ago

3.0.4

12 years ago

3.0.3

12 years ago

3.0.2

12 years ago

3.0.1

13 years ago

3.0.0

13 years ago

2.0.3

13 years ago

2.0.2

13 years ago

2.0.1

13 years ago

2.0.0

13 years ago