nafs
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Node Active FS - nafs

Nafs is an abstraction of the Node fs API where you can choose to point the fs to a remote location like s3, postgres, logstash, kibana or locally like the local filesystem or in memory. Check the compatiblility table to see which parts of the fs API has been implemented for each backend.

npm install nafs

API docs
npm
Github

Enable cache for remote data

const remoteFs = nafs('s3://key:secret@us-east-1/bucket_name');
const localFs = nafs('/tmp/some_folder');

await remoteFs.promises.writeFile('/hello', 'Hello World');
await remoteFs.promises.readFile('/hello', 'utf8'); // Hello World

await localFs.promises.writeFile('/hello', 'Hello World');
await localFs.promises.readFile('/hello', 'utf8'); // Hello World

Supported File System Methods

Method File System Memory Amazon S3 Google Cloud Storage Azure Storage
promises.readFile
promises.writeFile
promises.unlink
promises.rmdir
promises.mkdir
promises.readdir
promises.stat
promises.lstat
promises.chmod
promises.chown
promises.utimes
promises.rename
promises.copyFile
promises.symlink
promises.readlink
promises.truncate
promises.access
createReadStream
createWriteStream

✅ - Implemented
❌ - Not Implemented

File System and Memory implementations are provided via memfs and linkfs, supporting full Node.js fs API compatibility. Cloud storage implementations (Amazon S3, Google Cloud Storage, Azure Storage) are under development, with S3 currently supporting basic file reading and writing operations.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.24latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.24
0.1.14
0.1.03
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.10

Package Sidebar

Install

npm i nafs

Weekly Downloads

11

Version

0.1.2

License

MIT

Unpacked Size

58.3 kB

Total Files

43

Last publish

Collaborators

  • ricsam