{"_id":"file-importer","_rev":"942242","name":"file-importer","description":"Assembles source file trees using Sass-style @import statements.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"time":{"modified":"2021-09-23T02:08:25.000Z","created":"2015-05-29T19:48:24.713Z","1.0.0":"2015-09-21T03:15:31.798Z","0.0.7":"2015-09-21T00:54:32.272Z","0.0.6":"2015-07-02T18:24:48.359Z","0.0.5":"2015-07-02T00:54:03.466Z","0.0.4":"2015-07-01T20:21:05.330Z","0.0.3":"2015-06-05T20:15:22.366Z","0.0.2":"2015-05-30T20:51:32.810Z","0.0.1":"2015-05-29T19:48:24.713Z"},"users":{},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"https://github.com/gmac/file-importer"},"versions":{"1.0.0":{"name":"file-importer","version":"1.0.0","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"https://github.com/gmac/file-importer"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"5965837697ddfa572338bb5628165f1fdcc84391","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer","_id":"file-importer@1.0.0","_shasum":"0caef50d070d2e77281989595f6b82616eddb289","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"0caef50d070d2e77281989595f6b82616eddb289","size":7217,"noattachment":false,"key":"/file-importer/-/file-importer-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-1.0.0.tgz"},"publish_time":1442805331798,"_cnpm_publish_time":1442805331798,"_hasShrinkwrap":false},"0.0.7":{"name":"file-importer","version":"0.0.7","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"https://github.com/gmac/file-importer"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"96f68e24bfeea673bb06fa0cfe818ed7d512b9ea","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer","_id":"file-importer@0.0.7","_shasum":"56f8a46427eb59ffe0d570fb1f9d5b58f2d2b760","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"56f8a46427eb59ffe0d570fb1f9d5b58f2d2b760","size":7093,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.7.tgz"},"publish_time":1442796872272,"_cnpm_publish_time":1442796872272,"_hasShrinkwrap":false},"0.0.6":{"name":"file-importer","version":"0.0.6","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"git+https://github.com/gmac/file-importer.git"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"68c468f42ea6acbd6a3173c249cb3da233eddb80","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer#readme","_id":"file-importer@0.0.6","_shasum":"e47ba94b8b1b5bdfe8ea011c6748da0b1f3ec1d5","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"e47ba94b8b1b5bdfe8ea011c6748da0b1f3ec1d5","size":7021,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.6.tgz"},"publish_time":1435861488359,"_cnpm_publish_time":1435861488359,"_hasShrinkwrap":false},"0.0.5":{"name":"file-importer","version":"0.0.5","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"git+https://github.com/gmac/file-importer.git"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"b99e86b884c5386f2568538e672ada299d5f1eb7","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer#readme","_id":"file-importer@0.0.5","_shasum":"b1bf38f6d35755eeb2fb501dc6827a40a0ec8250","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"b1bf38f6d35755eeb2fb501dc6827a40a0ec8250","size":6899,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.5.tgz"},"publish_time":1435798443466,"_cnpm_publish_time":1435798443466,"_hasShrinkwrap":false},"0.0.4":{"name":"file-importer","version":"0.0.4","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"git+https://github.com/gmac/file-importer.git"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"40b4bc068cc7ab0e92d7a43ac497be5b2f070abb","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer#readme","_id":"file-importer@0.0.4","_shasum":"2d9419f6f51aec5918ea0798f3420017df3d44e7","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"2d9419f6f51aec5918ea0798f3420017df3d44e7","size":6529,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.4.tgz"},"publish_time":1435782065330,"_cnpm_publish_time":1435782065330,"_hasShrinkwrap":false},"0.0.3":{"name":"file-importer","version":"0.0.3","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"git+https://github.com/gmac/file-importer.git"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"87f8ad3823951fe681eada885c16a6b3ac2116bb","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer#readme","_id":"file-importer@0.0.3","_shasum":"e61047db94b348a70dfb5a8aa8388ffa5bc6a75c","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"e61047db94b348a70dfb5a8aa8388ffa5bc6a75c","size":6528,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.3.tgz"},"publish_time":1433535322366,"_cnpm_publish_time":1433535322366,"_hasShrinkwrap":false},"0.0.2":{"name":"file-importer","version":"0.0.2","description":"Assembles source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"repository":{"type":"git","url":"https://github.com/gmac/file-importer"},"github":"https://github.com/gmac/file-importer","license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"a26ca0ef5b9ffafcf41128aa8308580297f37ab3","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"homepage":"https://github.com/gmac/file-importer","_id":"file-importer@0.0.2","_shasum":"af6465662de91b8748a2250f2de359c2f9393276","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"af6465662de91b8748a2250f2de359c2f9393276","size":6211,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.2.tgz"},"publish_time":1433019092810,"_cnpm_publish_time":1433019092810,"_hasShrinkwrap":false},"0.0.1":{"name":"file-importer","version":"0.0.1","description":"Assembler for source file trees using Sass-style @import statements.","main":"index.js","directories":{},"scripts":{"test":"node ./test/mocha.js"},"author":{"name":"Greg MacWilliam"},"license":"MIT","dependencies":{"node-dir":"^0.1.8"},"devDependencies":{"mocha":"^2.2.5"},"gitHead":"fde1ad4b8f11b1d36fa74b65f1eea0f00aac8252","_id":"file-importer@0.0.1","_shasum":"4a1062e2607ad22ba1979e5b54d96a593e9dcaed","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"gmacwilliam","email":"gmacwill77@gmail.com"},"maintainers":[{"name":"gmacwilliam","email":"gmacwill77@gmail.com"}],"dist":{"shasum":"4a1062e2607ad22ba1979e5b54d96a593e9dcaed","size":5082,"noattachment":false,"key":"/file-importer/-/file-importer-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/file-importer/download/file-importer-0.0.1.tgz"},"publish_time":1432928904713,"_cnpm_publish_time":1432928904713,"_hasShrinkwrap":false}},"readme":"# file-importer\n\nAn `@import` statement processor for assembling Sass and other source file trees into a flattened source. This is useful for assembling a raw Sass codebase into an aggregate source, or using the Sass `@import` workflow as an aggregator for other filetypes.\n\nThis is a lightweight standalone library; it does NOT dependend on an actual Sass engine. All files are read, parsed for imports, and assembled entirely as plain text. File access and compilation is performed directly through Node, and `@import` statements are parsed from texts using regular expressions.\n\n**So... I can assemble my Sass source tree into a flat file?**\n\nYes. However – be mindful that imports are resolved through plain text that is not contextually aware, therefore `@import` statements within comments will still be discovered and parsed. For lexically-aware parsing of Sass source trees, see the [sass-ast](https://github.com/gmac/sass-ast) project.\n\n\n## Install\n\n```\nnpm install file-importer --save-dev\n```\n\n## Usage\n\n```javascript\nvar path = require('path');\nvar fileImporter = require('file-importer');\n\nfileImporter.parse({\n    file: 'lib/index',\n    cwd: path.resolve(__dirname),\n    includePaths: ['./base/']\n  },\n  function(err, data) {\n    if (err) throw err;\n    console.log(data);\n  });\n```\n\n### fileImporter.parse( options, callback )\n\n#### Required options, one or both:\n\n* **`file`**: String path to the file to load and parse. This may be an absolute path, or else a relative path from `process.cwd()` (or the provided `cwd` option). Uses `./` by default.\n\n* **`data`**: String data to parse. When provided, file read is skipped and the provided string is parsed as file contents. You may still provide a `file` option as path context for mapping imports.\n\n#### Optional options:\n\n* **`cwd`**: Path of the directory to resolve `file` reference and `includePaths` from. Uses `process.cwd()` by default.\n\n* **`includePaths`**: Array of base paths to search while perform file lookups. These should be absolute directory paths, or else relative to `process.cwd()` (or the provided `cwd` option).\n\n* **`extensions`**: Array of file extensions to search while performing lookups. Set as `['.scss']` by default (for standard Sass import behavior). You could set this to, say, `['.txt']` to import a tree of plain text files.\n\n## Import Rules\n\nSass-style imports are fairly blunt instruments. There's not a lot of magic here:\n\n**To parse `lib/sfoo`:**\n\n1. Look for `<cwd>/lib/sfoo`. If it's a directory, import all contents.\n2. Look for `<cwd>/lib/sfoo.scss`. FileImporter does this with all provided extensions.\n3. Look for `<cwd>/lib/_sfoo.scss`. FileImporter does this with all provided extensions.\n4. Perform steps 1-3 swapping `<cwd>` for each of `includePaths`.\n\n## Test\n\nTo run tests:\n\n```\nnpm test\n```\n","_attachments":{},"homepage":"https://github.com/gmac/file-importer","bugs":{"url":"https://github.com/gmac/file-importer/issues"},"license":"MIT"}