platina
An advanced in-memory file system
Last updated 3 years ago by samvv .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install platina 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

8 Versions

  • 1.0.0                                ...           3 years ago
  • 0.3.0 [deprecated]           ...           3 years ago
  • 0.2.2 [deprecated]           ...           3 years ago
  • 0.2.1 [deprecated]           ...           3 years ago
  • 0.2.0 [deprecated]           ...           3 years ago
  • 0.1.0 [deprecated]           ...           3 years ago
  • 0.0.2 [deprecated]           ...           3 years ago
  • 0.0.1 [deprecated]           ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 8
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |