Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-stat

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-stat - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

24

index.js
'use strict';
var through = require('through2');
var fs = require('graceful-fs');
var utils = require('./utils');
module.exports = function fileStats() {
return through.obj(function (file, enc, cb) {
var stream = this;
return utils.through.obj(function (file, enc, cb) {
getStats(file, function (err, res) {
if (err) {
stream.emit('error', err);
return cb();
cb(err);
return;
}
stream.push(res);
return cb();
cb(null, res);
});

@@ -22,7 +18,9 @@ });

function getStats(file, cb) {
fs.lstat(file.path, function (err, stat) {
if (err) return cb(err);
utils.fs.lstat(file.path, function (err, stat) {
if (err) {
cb(err);
return;
}
file.stat = stat;
return cb(null, file);
cb(null, file);
});

@@ -29,0 +27,0 @@ }

{
"name": "file-stat",
"description": "Set the `stat` property on a file object in a stream. Abstraction from vinyl-fs to support stream or non-stream usage.",
"version": "0.1.1",
"description": "Set the `stat` property on a file object. Abstraction from vinyl-fs to support stream or non-stream usage.",
"version": "0.1.2",
"homepage": "https://github.com/jonschlinkert/file-stat",

@@ -24,5 +24,11 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"graceful-fs": "^4.1.2",
"lazy-cache": "^0.2.3",
"through2": "^2.0.0"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-istanbul": "^0.10.1",
"gulp-jshint": "^1.11.2",
"gulp-mocha": "^2.1.3",
"jshint-stylish": "^2.0.1",
"mocha": "*"

@@ -29,0 +35,0 @@ },

# file-stat [![NPM version](https://badge.fury.io/js/file-stat.svg)](http://badge.fury.io/js/file-stat)
> Set the `stat` property on a file object in a stream. Abstraction from vinyl-fs to support stream or non-stream usage.
> Set the `stat` property on a file object. Abstraction from vinyl-fs to support stream or non-stream usage.

@@ -51,7 +51,7 @@ This is inspired by the `file.stat` code in [vinyl-fs](http://github.com/wearefractal/vinyl-fs). I needed a function that essentially did the same thing but could be used with stream or non-stream code.

* [file-contents](https://github.com/jonschlinkert/file-contents): Set the `contents` property on a file object in a stream.
* [file-symlinks](https://github.com/jonschlinkert/file-symlinks): Resolve symlinks and expose the `stat` property on a file object.
* [stream-loader](https://github.com/jonschlinkert/stream-loader): create a read stream from a glob of files. can be used as a loader-cache… [more](https://github.com/jonschlinkert/stream-loader)
* [vinyl](http://github.com/wearefractal/vinyl): A virtual file format
* [vinyl-fs](http://github.com/wearefractal/vinyl-fs): Vinyl adapter for the file system
* [file-contents](https://www.npmjs.com/package/file-contents): Set the `contents` property on a file object. Abstraction from vinyl-fs to support stream or… [more](https://www.npmjs.com/package/file-contents) | [homepage](https://github.com/jonschlinkert/file-contents)
* [file-symlinks](https://www.npmjs.com/package/file-symlinks): Resolve symlinks and expose the `stat` property on a file object. | [homepage](https://github.com/jonschlinkert/file-symlinks)
* [stream-loader](https://www.npmjs.com/package/stream-loader): create a read stream from a glob of files. can be used as a loader-cache… [more](https://www.npmjs.com/package/stream-loader) | [homepage](https://github.com/jonschlinkert/stream-loader)
* [vinyl](https://www.npmjs.com/package/vinyl): A virtual file format | [homepage](http://github.com/gulpjs/vinyl)
* [vinyl-fs](https://www.npmjs.com/package/vinyl-fs): Vinyl adapter for the file system | [homepage](http://github.com/wearefractal/vinyl-fs)

@@ -68,3 +68,3 @@ ## Running tests

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/file-stat/issues/new)
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/file-stat/issues/new).

@@ -85,2 +85,2 @@ ## Author

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 15, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 05, 2015._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc