{"_id":"path-segments","_rev":"9-2ac8679aaaa7574ac2d2af7d6e9266e3","name":"path-segments","description":"Get n specific segments of a file path, e.g. first 2, last 3, etc.","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"path-segments","description":"Get specific segments of a file path. First, last, last two, first two, etc.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/path-segments","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/path-segments.git"},"bugs":{"url":"https://github.com/jonschlinkert/path-segments/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/path-segments/blob/master/LICENSE-MIT"}],"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"dependencies":{"lodash":"^2.4.1","parse-filepath":"^0.3.0"},"_id":"path-segments@0.1.0","_shasum":"2308091fc973eeca683f4ea4a96c106fd9d6eb28","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"2308091fc973eeca683f4ea4a96c106fd9d6eb28","tarball":"https://registry.npmjs.org/path-segments/-/path-segments-0.1.0.tgz","integrity":"sha512-ZHldstCXRdcvmKESTFhL0TxYxJ+TGzsuHf9FYgvwp5IWVMyjcXB9GRsxaiS5pmutCNV4GBsthmcnhj/jBhQJkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIAx3mLRekgO61akztQxQCJUCUaxtOZK4Y7qHIvGVsxAiB9DYb7aT6/g6hyvMAjy3RF4OF91dX20Zs2Ub1Oy+cMVw=="}]}},"0.1.1":{"name":"path-segments","description":"Get n specific segments of a file path, e.g. first 2, last 3, etc.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/path-segments","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/path-segments.git"},"bugs":{"url":"https://github.com/jonschlinkert/path-segments/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/path-segments/blob/master/LICENSE-MIT"}],"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":"~0.2.6","chai":"~1.9.1","mocha":"*"},"dependencies":{"lodash":"^2.4.1","parse-filepath":"^0.3.0"},"_id":"path-segments@0.1.1","_shasum":"ff908ddf8577e77f6ada4831528ac2283c1527c8","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"ff908ddf8577e77f6ada4831528ac2283c1527c8","tarball":"https://registry.npmjs.org/path-segments/-/path-segments-0.1.1.tgz","integrity":"sha512-wnK1l8a9T502qoaVyBGZKu9iGcmnO5wStW0BQEa5yuLhKd/PeeQlJwm9WzWYTd6MW7n0K04n88x1giEcX/62LA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxSdd4UHlr/250/8dL4rFS0LsZQyXTPeUU4QHKhjVykwIgYspSRdrddKRDWw8mciT3/UxO+lLStkqnyEQ8ob1/H54="}]}}},"readme":"# path-segments [![NPM version](https://badge.fury.io/js/path-segments.png)](http://badge.fury.io/js/path-segments)\n\n> Get specific segments of a file path. First, last, last two, first two, etc.\n\n## Install\nInstall with [npm](npmjs.org):\n\n```bash\nnpm i path-segments --save-dev\n```\n\n## Usage\n\n```js\nvar segements = require('path-segments');\n```\n\n## Tests\n\nIn the command line, run `npm test` or `mocha`.\n\n\n### first\n\nGet the first `n` segments of a path:\n\n```js\nsegments('a/b/c', {first: 1});\n//=> 'a'\nsegments('./a/b/c', {first: 1});\n//=> 'a'\nsegments('/a/b/c.js', {first: 1});\n//=> 'a'\nsegments('/a/b/c/', {first: 1});\n//=> 'a'\nsegments('a\\\\b\\\\c', {first: 1});\n//=> 'a'\nsegments('.\\\\a\\\\b\\\\c.js', {first: 1});\n//=> 'a'\nsegments('.\\\\a\\\\b\\\\c\\\\', {first: 2});\n//=> 'a/b'\nsegments('.\\\\a\\\\b\\\\c.js', {first: 2});\n//=> 'a/b'\nsegments('/a/b/c.js', {first: 3});\n//=> 'a/b/c.js'\nsegments('/a/b/c/', {first: 3});\n//=> 'a/b/c'\nsegments('a\\\\b\\\\c', {first: 3});\n//=> 'a/b/c'\nsegments('a\\\\b\\\\c\\\\', {first: 3});\n//=> 'a/b/c'\nsegments('.\\\\a\\\\b\\\\c.js', {first: 3});\n//=> 'a/b/c.js'\n```\n\n### last\n\nGet the last `n` segments of a path:\n\n```js\nsegments('a/b/c');\n//=> 'c'\nsegments('./a/b/c');\n//=> 'c'\nsegments('./a/b/c.js');\n//=> 'c.js'\nsegments('/a/b/c.js');\n//=> 'c.js'\nsegments('/a/b/c/');\n//=> 'c'\nsegments('.\\\\a\\\\b\\\\c\\\\');\n//=> 'c'\nsegments('.\\\\a\\\\b\\\\c.js');\n//=> 'c.js'\nsegments('/a/b/c.js', {last: 2});\n//=> 'b/c.js'\nsegments('/a/b/c/', {last: 2});\n//=> 'b/c'\nsegments('a\\\\b\\\\c', {last: 2});\n//=> 'b/c'\nsegments('.\\\\a\\\\b\\\\c.js', {last: 2});\n//=> 'b/c.js'\nsegments('./a/b/c/', {last: 3});\n//=> 'a/b/c'\nsegments('a/b/c.js', {last: 3});\n//=> 'a/b/c.js'\nsegments('.\\\\a\\\\b\\\\c\\\\', {last: 3});\n//=> 'a/b/c'\nsegments('.\\\\a\\\\b\\\\c.js', {last: 3});\n//=> 'a/b/c.js'\n```\n\nSee [the tests](./test/test.js) for more examples.\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2014 Jon Schlinkert, contributors.  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 26, 2014._","maintainers":[{"email":"brian.woodward@gmail.com","name":"doowb"},{"email":"github@sellside.com","name":"jonschlinkert"}],"time":{"modified":"2022-06-23T14:41:14.976Z","created":"2014-06-26T04:01:35.303Z","0.1.0":"2014-06-26T04:01:35.303Z","0.1.1":"2014-06-26T04:03:05.582Z"},"homepage":"https://github.com/jonschlinkert/path-segments","keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"repository":{"type":"git","url":"git://github.com/jonschlinkert/path-segments.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/path-segments/issues"},"readmeFilename":"README.md","users":{"tunnckocore":true}}