1.0.0 • Published 7 years ago

platina v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Platina

Platina is an advanced in-memory file system, closely resembling the NodeJS FileSystem API. Platina is ideal for use in your test suites and for applications requiring a virtual file system, such as compilers and asset bundlers.

npm i --save platina

Features

  • JSFS-compatible API
  • Synchronous and asynchronous operations using promises
  • Growing number of NodeJS FileSystem API methods supported
  • Efficient writes and reads of unpredictably sized data
  • Fully working in a browser environment

API

import Platina from "platina"

const fs = new Platina()

// now do whatever what you'd do with a normal `fs` object

fs.writeFileSync('/test.txt', 'some content ...')

// ...

Refer to the official NodeJS FileSystem docs for the full documentation of the methods you can use. Should you find anything that does not comply with the official docs, please file an issue.

JSFS

Just as fs-extra, Platina fully integrates with JSFS, making it possible to create isolated file systems and more.

import Platina from "platina"
import isolate from "jsfs/isolate"

const fs = new Platina()
fs.mkdirSync('/foo')

newfs = isolate(fs, '/foo')

newfs.writeFileSync('/test.txt', 'foo bar baz') // will write to /foo/test.txt

Contributing

Need help? Found a bug? An inconsistency with the JSFS API, perhaps? Please open a new issue and we'll discuss how we can solve the problem!

License

The MIT License

1.0.0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago