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

fs-utils

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-utils - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

docs/api.md

2

bower.json
{
"name": "fs-utils",
"version": "0.3.4",
"version": "0.3.5",
"main": [

@@ -5,0 +5,0 @@ "index.js"

@@ -281,5 +281,5 @@ /**

// the first is returned
file.findFile = function(filepath, options) {
var opts = _.extend({filter: 'isFile'}, options);
var str = glob.find(filepath, opts)[0];
file.findFile = function() {
var filepath = path.join.apply(path, arguments);
var str = glob.find(filepath, {filter: 'isFile'})[0];
return str ? String(path.resolve(str)) : null;

@@ -291,5 +291,5 @@ };

// the first direc returned
file.findDir = function(dir, options) {
var opts = _.extend({filter: 'isDirectory'}, options);
var str = glob.find(dir, opts)[0];
file.findDir = function() {
var filepath = path.join.apply(path, arguments);
var str = glob.find(filepath, {filter: 'isDirectory'})[0];
return str ? String(path.resolve(str)) : null;

@@ -571,4 +571,9 @@ };

};
file.firstDir = file.firstSegment;
// First segment of a file path
file.firstDir = function (f) {
var filepath = path.join.apply(path, arguments);
return _.initial(filepath.split('/')).join('/');
};
// Directory path

@@ -592,8 +597,2 @@ file.dirname = function() {

/**
* Path "endings"
*/
// Last dictory path segment, excluding the filename

@@ -610,2 +609,7 @@ file.lastDir = function() {

/**
* Path "endings"
*/
// The last character in a filepath. 'foo/bar/baz/' => '/'

@@ -648,2 +652,12 @@ file.lastChar = function(filepath) {

// Ensure that filepath has trailing slash
file.slashify = function () {
var filepath = path.join.apply(path, arguments);
var last = _.last((filepath).split('/'));
if(last.indexOf('.') === -1) {
return filepath.replace(/\/$/, '') + '/';
} else {
return filepath;
}
};

@@ -650,0 +664,0 @@

{
"name": "fs-utils",
"version": "0.3.4",
"version": "0.3.5",
"description": "File system extras and utilities to extend the Node.js fs module.",

@@ -5,0 +5,0 @@ "repository": {

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