0.0.0-alpha • Published 7 years ago

node-flydrive v0.0.0-alpha

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

node-flydrive is a framework-agnostic package which provides a powerful wrapper to manage Storage in Node.js.

:pray: This package is under active development, some breaking changes may occur before the first release.

Table of Contents

This package is available in the Node Package Repository. It can easily be installed with npm.

$ npm i --save node-flydrive

When you require the package in your file, it will give you access to the StorageManager class. This class is a facade for the package and should be instantiated with a configuration object.

const StorageManager = require('node-flydrive')
const storage = new StorageManager(config)

// Note that we are using co to run this code.
// @see https://github.com/tj/co
co(function* () {
  // Use the default disk.
  const file = yield storage.get('storage/logs.txt')
  console.log(file.toString())

  // Specify wich disk you want to use.
  const file = yield storage.disk('local').get('storage/logs.txt')
  console.log(file.toString())
})

Any pull requests or discussions are welcome. Note that every pull request providing new feature or correcting a bug should be created with appropriate unit tests.

Nothing will be wrote here before the release of the first version.