0.2.1 • Published 8 years ago

newcore v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

node core libs with promises and better errors

Currently just fs is supported.

npm install --save newcore

fs

Example:

var fs = require('newcore/lib/fs');

fs.readFile('lorem.txt', 'utf-8')
.then((text) => {
  console.log(text);
})

// selective error handling
.catch(fs.errors.NotFound, () => {
  console.log('File lorem.txt is missing');
});

Errors:

CodeError Name
EACCESfs.errros.PermissionDenied
EEXISTfs.errors.FileExists
EISDIRfs.errors.IsDirectory
ENOTDIRfs.errors.NotDirectory
ENOTEMPTYfs.errors.NotEmptyDirectory
ENOENTfs.errors.NotFound
EMFILEfs.errors.OutOfFileDescriptors
EPERMfs.errors.Permissions
0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago