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

gulp-path-length

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-path-length

A Gulp plugin for enforcing a character limit on file paths

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

gulp-path-length

NPM version Build Status Windows Build Status Dependency Status


A Gulp plugin for enforcing a character limit on file paths. Created with Windows' 256 character limit in mind but can be used on other platforms too.

Installation

npm install gulp-path-length

Usage

var gulp = require('gulp');
var pathLength = require('gulp-path-length');

gulp.task('default', function(){
    gulp.src('./example/path/to/directory/**', {read: false})
        .pipe(pathLength()); 
});

This will stop the build with an error if you've an overly long path. I've passed {read: false} to gulp.src here because we don't need to read the contents, we just need the paths. But if you're using gulp-path-length after some other pipes, it's likely you shouldn't pass {read: false}.

API

There is only one (optional) parameter; an options object. The possible properties it can contain are:

  • maxLength - defaults to 256
  • rewrite - This is an optional object which should contain match and replacement properties which contains mappings between directories. So for example:
rewrite: {
    match: './example/path/to/directory/',
    replacement: 'C:\\Program Files (x86)\\abc'
}

When the plugin goes to check the file ./example/path/to/directory/x.txt, it will actually check C:\Program Files (x86)\abc\x.txt.

  • rewrite.match accepts a path to resolve (like ./example), relative (example/a) or absolute paths (C:\a).
  • rewrite.replacement only accepts an absolute path.

Keywords

FAQs

Package last updated on 15 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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