{"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"keywords":["filepath","file-path","path","dir","directory","strip","strip-components"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"description":"Remove leading directory components from a path, like tar's --strip-components option","readme":"# strip-dirs \n\n[![NPM version](https://img.shields.io/npm/v/strip-dirs.svg)](https://www.npmjs.com/package/strip-dirs)\n[![Build Status](https://img.shields.io/travis/shinnn/node-strip-dirs.svg)](https://travis-ci.org/shinnn/node-strip-dirs)\n[![Build status](https://ci.appveyor.com/api/projects/status/pr5edbtg59f6xfgn?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/node-strip-dirs)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/node-strip-dirs.svg)](https://coveralls.io/r/shinnn/node-strip-dirs)\n[![Dependency Status](https://david-dm.org/shinnn/node-strip-dirs.svg)](https://david-dm.org/shinnn/node-strip-dirs)\n[![devDependency Status](https://david-dm.org/shinnn/node-strip-dirs/dev-status.svg)](https://david-dm.org/shinnn/node-strip-dirs#info=devDependencies)\n\nRemove leading directory components from a path, like [tar(1)](http://linuxcommand.org/man_pages/tar1.html)'s `--strip-components` option\n\n```javascript\nconst stripDirs = require('strip-dirs');\n\nstripDirs('foo/bar/baz', 1); //=> 'bar/baz'\nstripDirs('foo/bar/baz', 2); //=> 'baz'\nstripDirs('foo/bar/baz', 999); //=> 'baz'\n```\n\n## Installation\n\n[Use npm](https://docs.npmjs.com/cli/install).\n\n```\nnpm install --save strip-dirs\n```\n\n## API\n\n```javascript\nconst stripDirs = require('strip-dirs');\n```\n\n### stripDirs(*path*, *count* [, *option*])\n\n*path*: `String` (A relative path)  \n*count*: `Number` (0, 1, 2, ...)  \n*option*: `Object`  \nReturn: `String`\n\nIt removes directory components from the beginning of the *path* by *count*.\n\n```javascript\nconst stripDirs = require('strip-dirs');\n\nstripDirs('foo/bar', 1); //=> 'bar'\nstripDirs('foo/bar/baz', 2); //=> 'bar'\nstripDirs('foo/././/bar/./', 1); //=> 'bar'\nstripDirs('foo/bar', 0); //=> 'foo/bar'\n\nstripDirs('/foo/bar', 1) // throw an error because the path is an absolute path\n```\n\nIf you want to remove all directory components certainly, use [`path.basename`](http://nodejs.org/api/path.html#path_path_basename_p_ext) instead of this module.\n\n#### option.disallowOverflow\n\nType: `Boolean`  \nDefault: `false`\n\nBy default, it keeps the last path component when path components are fewer than the *count*.\n\nIf this option is enabled, it throws an error in this situation.\n\n```javascript\nstripDirs('foo/bar/baz', 9999); //=> 'baz'\n\nstripDirs('foo/bar/baz', 9999, {disallowOverflow: true}); // throws an range error\n```\n\n## License\n\nCopyright (c) 2014 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n","repository":{"type":"git","url":"git+https://github.com/shinnn/node-strip-dirs.git"},"bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"license":"MIT","versions":{"0.0.0":{"name":"strip-dirs","version":"0.0.0","description":"Remove leading directory components from a path, such as tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"./cli.js"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"tape test.js | tap-spec"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"files":["cli.js","index.js","LICENSE"],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"get-stdin":"^3.0.0","is-absolute":"^0.1.4","is-integer":"^1.0.3","minimist":"^1.1.0"},"devDependencies":{"eslint":"^0.7.4","jscs":"^1.5.9","require-main":"^0.1.1","tap-spec":"^0.2.0","tape":"^2.14.0"},"gitHead":"1da09087b67040ddaf90b4fc75f35ddf40f89d9c","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@0.0.0","_shasum":"86ee1090fa76cc09c37f7f3c10bc4ff9ed5b23b3","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"86ee1090fa76cc09c37f7f3c10bc4ff9ed5b23b3","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-0.0.0.tgz"},"directories":{}},"0.1.0":{"name":"strip-dirs","version":"0.1.0","description":"Remove leading directory components from a path, such as tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"./cli.js"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"tape test.js | tap-spec"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"files":["cli.js","index.js","LICENSE"],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"get-stdin":"^3.0.0","is-absolute":"^0.1.4","is-integer":"^1.0.3","minimist":"^1.1.0"},"devDependencies":{"eslint":"^0.7.4","jscs":"^1.5.9","require-main":"^0.1.1","tap-spec":"^0.2.0","tape":"^2.14.0"},"gitHead":"b60d177daec4a741079c15fa8b80f2a6a5f930cd","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@0.1.0","_shasum":"c99bf18d75e9cd13749d8bea7b6b364f767b8d2e","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"c99bf18d75e9cd13749d8bea7b6b364f767b8d2e","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-0.1.0.tgz"},"directories":{}},"0.1.1":{"name":"strip-dirs","version":"0.1.1","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"./cli.js"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"tape test.js | tap-spec"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"files":["cli.js","index.js","LICENSE"],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"chalk":"^0.5.1","get-stdin":"^3.0.0","is-absolute":"^0.1.4","is-integer":"^1.0.3","minimist":"^1.1.0"},"devDependencies":{"eslint":"^0.7.4","jscs":"^1.5.9","require-main":"^0.1.1","tap-spec":"^0.2.1","tape":"^2.14.0"},"gitHead":"676166771baeaa6fae9f8663d159111f535b9913","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@0.1.1","_shasum":"5524b3a50231e015d0814ec42b89a76427df62e8","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"5524b3a50231e015d0814ec42b89a76427df62e8","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-0.1.1.tgz"},"directories":{}},"1.0.0":{"name":"strip-dirs","version":"1.0.0","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"./cli.js"},"files":["cli.js","index.js","LICENSE"],"scripts":{"pretest":"eslint *.js & jscs *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"chalk":"^0.5.1","get-stdin":"^3.0.2","is-absolute":"^0.1.5","is-natural-number":"^1.0.0","minimist":"^1.1.0"},"devDependencies":{"eslint":"^0.9.2","istanbul":"^0.3.2","istanbul-coveralls":"^1.0.1","jscs":"^1.7.3","tap-spec":"^2.1.0","tape":"^3.0.3"},"jscsConfig":{"preset":"google","maximumLineLength":95},"gitHead":"30e2e454d60614b2913b121a87a69c96699b2f20","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@1.0.0","_shasum":"6414f2b843ae5b8c46dc70c514ea3b2366708c0e","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.33","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"6414f2b843ae5b8c46dc70c514ea3b2366708c0e","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-1.0.0.tgz"},"directories":{}},"1.0.1":{"name":"strip-dirs","version":"1.0.1","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"cli.js"},"files":["cli.js","index.js"],"scripts":{"pretest":"jscs *.js && eslint *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"chalk":"^0.5.1","get-stdin":"^4.0.1","is-absolute":"^0.1.5","is-natural-number":"^1.0.0","minimist":"^1.1.0","sum-up":"^1.0.0"},"devDependencies":{"eslint":"^0.12.0","istanbul":"^0.3.5","istanbul-coveralls":"^1.0.1","jscs":"^1.10.0","tap-spec":"^2.2.0","tape":"^3.4.0"},"jscsConfig":{"preset":"google","maximumLineLength":95},"gitHead":"bb7e4f90a11b9711e04e1cfffebb60c4f24d70fd","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@1.0.1","_shasum":"36a5716e654007de049f0f20c17ae3e512757266","_from":".","_npmVersion":"2.3.0","_nodeVersion":"1.0.1","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"36a5716e654007de049f0f20c17ae3e512757266","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-1.0.1.tgz"},"directories":{}},"1.1.0":{"name":"strip-dirs","version":"1.1.0","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"cli.js"},"files":["cli.js","index.js"],"scripts":{"pretest":"jscs *.js && eslint *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"chalk":"^0.5.1","get-stdin":"^4.0.1","is-absolute":"^0.1.5","is-natural-number":"^2.0.0","minimist":"^1.1.0","sum-up":"^1.0.0"},"devDependencies":{"eslint":"^0.14.1","istanbul":"^0.3.5","istanbul-coveralls":"^1.0.1","jscs":"^1.11.3","tap-spec":"^2.2.1","tape":"^3.5.0"},"jscsConfig":{"preset":"google","maximumLineLength":95},"gitHead":"5819b8859b15e2151a65241ced9a842a547c5784","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@1.1.0","_shasum":"1dfeea37f39281e09eee55eb4a88ad0eea090cad","_from":".","_npmVersion":"2.5.0","_nodeVersion":"1.1.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"1dfeea37f39281e09eee55eb4a88ad0eea090cad","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-1.1.0.tgz"},"directories":{}},"1.1.1":{"name":"strip-dirs","version":"1.1.1","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"https://github.com/shinnn/node-strip-dirs"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"bin":{"strip-dirs":"cli.js"},"files":["cli.js","index.js"],"scripts":{"pretest":"jscs *.js && eslint *.js","test":"node test.js | tap-spec","coverage":"istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/node-strip-dirs/blob/master/LICENSE"}],"keywords":["path","dir","directory","strip","strip-components"],"dependencies":{"chalk":"^1.0.0","get-stdin":"^4.0.1","is-absolute":"^0.1.5","is-natural-number":"^2.0.0","minimist":"^1.1.0","sum-up":"^1.0.1"},"devDependencies":{"eslint":"^0.15.0","istanbul":"^0.3.6","istanbul-coveralls":"^1.0.1","jscs":"^1.11.3","tap-spec":"^2.2.1","tape":"^3.5.0"},"jscsConfig":{"preset":"google","maximumLineLength":95},"gitHead":"5fef3db9d046af108c1d8b54b99332d98dfa364a","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs","_id":"strip-dirs@1.1.1","_shasum":"960bbd1287844f3975a4558aa103a8255e2456a0","_from":".","_npmVersion":"2.6.0","_nodeVersion":"1.3.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"960bbd1287844f3975a4558aa103a8255e2456a0","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-1.1.1.tgz"},"directories":{}},"2.0.0":{"name":"strip-dirs","version":"2.0.0","description":"Remove leading directory components from a path, like tar's --strip-components option","repository":{"type":"git","url":"git+https://github.com/shinnn/node-strip-dirs.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"files":["index.js"],"scripts":{"pretest":"eslint --config @shinnn/cli --ignore-path .gitignore .","test":"node --strong_mode --throw-deprecation --track-heap-objects test.js | tap-spec","coverage":"node --strong_mode node_modules/.bin/istanbul cover test.js"},"license":"MIT","keywords":["filepath","file-path","path","dir","directory","strip","strip-components"],"dependencies":{"is-natural-number":"^4.0.1"},"devDependencies":{"@shinnn/eslint-config-cli":"^1.0.0","eslint":"^2.10.2","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","tap-spec":"^4.1.1","tape":"^4.5.1"},"gitHead":"eedce7da843c4a83d5da113bef2a653cb5f8a906","bugs":{"url":"https://github.com/shinnn/node-strip-dirs/issues"},"homepage":"https://github.com/shinnn/node-strip-dirs#readme","_id":"strip-dirs@2.0.0","_shasum":"610cdb2928200da0004f41dcb90fc95cd919a0b6","_from":".","_npmVersion":"3.9.2","_nodeVersion":"5.9.1","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"610cdb2928200da0004f41dcb90fc95cd919a0b6","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/strip-dirs/-/strip-dirs-2.0.0.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/strip-dirs-2.0.0.tgz_1464085485043_0.895226779859513"},"directories":{}}},"name":"strip-dirs","time":{"modified":"2016-05-24T10:24:45.508Z","created":"2014-08-18T18:56:20.030Z","0.0.0":"2014-08-18T18:56:20.030Z","0.1.0":"2014-08-18T19:37:11.245Z","0.1.1":"2014-08-20T15:26:26.932Z","1.0.0":"2014-11-23T12:37:30.816Z","1.0.1":"2015-01-23T19:15:01.265Z","1.1.0":"2015-02-15T05:44:40.511Z","1.1.1":"2015-02-24T11:39:09.422Z","2.0.0":"2016-05-24T10:24:45.508Z"},"readmeFilename":"README.md","homepage":"https://github.com/shinnn/node-strip-dirs#readme"}