fsstatwithpath
fs.stat With Path Included To Callback Result
Last updated 3 years ago by mfatihmar .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install fsstatwithpath 
SYNC missed versions from official npm registry.

fsstatwithpath

Current Version Build Status Coverage Status

fs.stat With Path Included To Callback Result

Installation

$ npm install fsstatwithpath

or

$ yarn add fsstatwithpath

Usage

Directory

var fswp = require("fsstatwithpath");

fswp("node_modules", (err, stats) => {
    if (err) {
        console.log("directory (error) => [" + err.code + "] " + err.path);
    }
    else {
        console.log("directory (success) => " + stats.path);
    }
});

fswp("xnode_modules", (err, stats) => {
    if (err) {
        console.log("directory (error) => [" + err.code + "] " + err.path);
    }
    else {
        console.log("directory (success) => " + stats.path);
    }
});

// OUTPUT
// directory (success) => node_modules
// directory (error) => [ENOENT] xnode_modules

File

var fswp = require("fsstatwithpath");

fswp("package.json", (err, stats) => {
    if (err) {
        console.log("file (error) => [" + err.code + "] " + err.path);
    }
    else {
        console.log("file (success) => " + stats.path);
    }
});

fswp("xpackage.json", (err, stats) => {
    if (err) {
        console.log("file (error) => [" + err.code + "] " + err.path);
    }
    else {
        console.log("file (success) => " + stats.path);
    }
});

// OUTPUT
// file (success) => package.json
// file (error) => [ENOENT] xpackage.json

Tests

$ npm test

or

$ yarn test

License

MIT

Current Tags

  • 1.1.3                                ...           latest (3 years ago)

5 Versions

  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 9
Last Day 1
Last Week 2
Last Month 2
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |