{"name":"map-dest","description":"Map the destination path for a file based on the given source path and options.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/map-dest","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-dest.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-dest/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"gulp":"^3.9.0","gulp-istanbul":"^0.10.0","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.0.1","mocha":"*","should":"*"},"keywords":["config","configuration","dest","destination","expand","files array","files object","files","normalize","options","src","src-dest","target","task"],"verb":{"related":{"list":["files-objects","expand-config","expand-files","expand-task","expand-target"]}},"gitHead":"724045b0685ed011ac1bb74618b335c84374e961","_id":"map-dest@0.1.0","_shasum":"a127edb30d5a1531f8f62b3229ddb340a3d12575","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"a127edb30d5a1531f8f62b3229ddb340a3d12575","tarball":"http://registry-npm.ywwl.com/map-dest/download/map-dest-0.1.0.tgz","integrity":"sha512-xtyEdf7BOVIMWMmASNRTFBxoQt4O9GjBZEHQuK25/GoYe7+9zOnubFiF4CleGutfpYwOuU1ibjmfwmIX0HEkGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1lujFOv/lLE0ug9f3F4BRGSjGuRQBhqWEJ9fuD164EgIgULJmQ6QlsIsx/S/x+ED0mJlx7OxMezaYVlNXq49Q92U="}],"size":3284,"noattachment":false,"key":"/map-dest/-/map-dest-0.1.0.tgz"},"directories":{},"readme":"# map-dest [![NPM version](https://badge.fury.io/js/map-dest.svg)](http://badge.fury.io/js/map-dest)\n\n> Map the destination path for a file based on the given source path and options.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i map-dest --save\n```\n\n## Usage\n\n```js\nvar mapDest = require('map-dest');\n```\n\n## Table of contents\n\n- [docs](#docs)\n  * [src](#src)\n  * [dest](#dest)\n- [options](#options)\n  * [options.flatten](#optionsflatten)\n  * [options.ext](#optionsext)\n  * [options.cwd](#optionscwd)\n  * [options.destBase](#optionsdestbase)\n  * [options.rename](#optionsrename)\n- [Related projects](#related-projects)\n- [Test coverage](#test-coverage)\n- [Running tests](#running-tests)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n## docs\n\n### src\n\nReturns an array when `src` is an array\n\n```js\nmapDest(['a.txt', 'b.txt'], 'dist');\n// [ { options: {}, src: 'a.txt', dest: 'dist/a.txt' },\n//   { options: {}, src: 'b.txt', dest: 'dist/b.txt' } ]\n```\n\n### dest\n\nCreates a dest when no `dest` argument is passed.\n\n```js\nmapDest('a/b/c.txt');\n// [{ options: {}, src: 'a/b/c.txt', dest: 'a/b/c.txt' }]\n```\n\nWhen no `dest` is defined and `src` is an array, returns an array with generated `dest` paths.\n\n```js\nmapDest(['a.txt', 'b.txt']);\n// [ { options: {}, src: 'a.txt', dest: 'a.txt' },\n//   { options: {}, src: 'b.txt', dest: 'b.txt' } ]\n```\n\n## options\n\n### options.flatten\n\nFlattens `dest` when no `dest` argument is passed:\n\n```js\nmapDest('a/b/c.txt', {flatten: true});\n// [{ options: { flatten: true }, src: 'a/b/c.txt', dest: 'c.txt' }]\n```\n\n### options.ext\n\nReplaces the destination extension with given `ext`:\n\n```js\nmapDest('a/b/c.txt', {ext: '.foo'});\n// [{ options: { ext: '.foo', extDot: 'first' },\n//   src: 'a/b/c.txt',\n//   dest: 'a/b/c.foo' }]\n```\n\n### options.cwd\n\nWhen `cwd` is defined it will be prepended to `src`:\n\n```js\nmapDest('a/b/c.txt', {cwd: 'one/two'});\n// [{ options: { cwd: 'one/two' },\n//   src: 'one/two/a/b/c.txt',\n//   dest: 'a/b/c.txt' }]\n```\n\nPrepends `cwd` to `src` and flattens `dest`:\n\n```js\nmapDest('a/b/c.txt', {cwd: 'one/two', flatten: true});\n// [{ options: { cwd: 'one/two', flatten: true },\n//   src: 'one/two/a/b/c.txt',\n//   dest: 'c.txt' }]\n```\n\nExpands tildes in `cwd` to make the path relative to the user's home directory:\n\n```js\nmapDest('a/b/c.txt', {cwd: '~/one/two'});\n// [{ options: { cwd: '/User/jonschlinkert/one/two', flatten: true },\n//   src: 'one/two/a/b/c.txt',\n//   dest: 'c.txt' }]\n```\n\nExpands `@` in `cwd` to make the path relative to global npm modules:\n\n```js\nmapDest('templates/base.hbs', {cwd: '@/boilerplate-h5bp'});\n// [ { options: { cwd: '/usr/local/lib/node_modules/boilerplate-h5bp' },\n//     src: '/usr/local/lib/node_modules/boilerplate-h5bp/templates/base.hbs',\n//     dest: 'templates/base.hbs' } ]\n```\n\n### options.destBase\n\nIf `destBase` is defined it's prepended to generated dest.\n\n```js\nmapDest('a/b/c.txt', {destBase: 'one/two'});\n// [{ options: { destBase: 'one/two' },\n//   src: 'a/b/c.txt',\n//   dest: 'one/two/a/b/c.txt' }]\n```\n\nIf `destBase` is defined, it will be prepended to dest\n\n```js\nmapDest('a/b/c.txt', 'foo', {destBase: 'one/two'});\n// [{ options: { destBase: 'one/two' },\n//   src: 'a/b/c.txt',\n//   dest: 'one/two/foo/a/b/c.txt' }]\n```\n\n### options.rename\n\nA custom `rename` function can be used to modify the generated `dest` path.\n\n```js\nmapDest('a/b/c.md', {\n  rename: function (dest, src, opts) {\n    return 'dist/' + path.basename(src) + '.html';\n  }\n});\n// [{ options: { rename: [Function] },\n//   src: 'a/b/c.md',\n//   dest: 'dist/c.html' }]\n```\n\n## Related projects\n\n* [expand-config](https://www.npmjs.com/package/expand-config): Expand tasks, targets and files in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-config)\n* [expand-files](https://www.npmjs.com/package/expand-files): Expand glob patterns in a declarative configuration into src-dest mappings. | [homepage](https://github.com/jonschlinkert/expand-files)\n* [expand-target](https://www.npmjs.com/package/expand-target): Expand target definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-target)\n* [expand-task](https://www.npmjs.com/package/expand-task): Expand and normalize task definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-task)\n* [files-objects](https://www.npmjs.com/package/files-objects): Expand files objects into src-dest mappings. | [homepage](https://github.com/jonschlinkert/files-objects)\n\n## Test coverage\n\n```\n-----------|----------|----------|----------|----------|----------------|\nFile       |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n-----------|----------|----------|----------|----------|----------------|\n map-dest/ |      100 |      100 |      100 |      100 |                |\n  index.js |      100 |      100 |      100 |      100 |                |\n-----------|----------|----------|----------|----------|----------------|\nAll files  |      100 |      100 |      100 |      100 |                |\n-----------|----------|----------|----------|----------|----------------|\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/map-dest/issues/new).\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\n\nCopyright © 2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 30, 2015._","publish_time":1441181207387,"_cnpm_publish_time":1441181207387,"dist-tags":{"latest":"0.1.8"}}