Skip to content
This project describe LSTAT error in more descriptive way.
Branch: master
Clone or download
Latest commit b488d3f Aug 22, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
node_modules First release of SWEET LSTAT Aug 21, 2014
README.md Update README.md Aug 21, 2014
lstatdemo.js Update lstatdemo.js Aug 22, 2014
package.json First release of SWEET LSTAT Aug 21, 2014

README.md

sweet-lstat

An easier way to track LSTAT errors.

Install

npm install slstat

API

  • getErrorFromNum(errno)

Parameters: {Number} errno The error number

Example:

var errdetail = require('slstat');
console.log(errdetail.getErrorFromNum(13).msg);

Output: "Permission is denied for one of the directories in the path."

  • getErrorFromCode(code)

Parameter:

{String} The error code e.g 'ENOENT'

Example:

var errdetail = require('slstat');
var err = errdetail.getErrorFromCode('ENOENT');
console.log(err);

Returns: An Error object containing

{
  code: 'ENOENT',
  msg: 'A component of the path or prefix of path is not a directory.No such file or directory exists at this provided   path.',
  errno: 2
}

Usage

You can use it in projects where logs are written and by using this package you can put error with description for understanding.

You can’t perform that action at this time.