DarkoKukovec / crypto-fs

Wrapper around node fs module that encrypts the files on the fly
MIT License
3 stars 6 forks source link

crypto-fs

Wrapper around node fs module that encrypts the files on the fly

Code Climate Test Coverage Build Status Dependency Status devDependency Status

Installation

npm install crypto-fs --save

Requirements

Node.js 4+

Initialization

var fs = require('crypto-fs');
fs.init({
  baseFs: require('fs'),
  algorithm: 'aes-256-ctr',
  prefix: '',
  password: '1234',
  root: './test/dest',
  iv: null,
  realSize: false,
  dontEncPath : false
});

Options

Base FS

By default, this module relies on the native fs module, but this can be changed. If you have a different module that exposes the same methods (e.g. ftp-fs, s3-fs), you can set it as the base fs. For every exposed method, it will be documented which methods does it require from the base fs (except for the same method, readlink/readlinkSync and lstat/lstatSync). readlink/readlinkSync and lstat/lstatSync are used to determine if the given path is a symlink, and in this case follow the symlink.

If you're using the default fs module, you can ignore this info.

Implemented methods

Not tested

Limitations / known issues

Challenges

TODO

Methods (Sync and async)

Attribution