{"bin":{"samson":"./bin.js"},"dist":{"shasum":"332dc03753d499296f7269e59ec64ba2067a4219","tarball":"https://registry.npmjs.org/samson/-/samson-0.3.1.tgz","integrity":"sha512-HKhyDAjWZxaFz4BjCID940KQV9u9HGSkFSZCN0arNOPCyrnpMjpy7D7FR8zM4M5m0O7rLLg0KU6PunzVMgs0zA==","signatures":[{"sig":"MEQCIFEZW9b2FQABDhk27QcaSGAhgnVq+4QwoQ0jzUB39JddAiBdi0V2bIzuAvIsaYldYx0K9MA0eNsXC12ZxvQFr2RWtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./main.js","name":"samson","_from":".","author":{"url":"http://github.com/drkibitz","name":"Dr. Kibitz","email":"drkibitz@gmail.com"},"readme":"Samson\n===========\n\n### The elevator pitch:\n\nA very useful build step; read any number of files, process them as JavaScript templates, and save output to another destination.\n\n### The more descriptive version:\n\nProcess an input directory to an output directory recursively:\n\n    samson -i path/to/directory -o path/to/other/directory -R\n\nSamson's functionality can be summarized in 3 steps:\n\n1. Read any number of files that are of any size\n2. Process the content of files read as doT.js templates\n    - Each template's delimiters are defined as comment blocks specific to the processed file's language\n    - Although files are processed in chunks, the internal validation queues data until it may be processed correctly\n    - If a file's mimeType is not a processable type, then the data is simply piped through without processing\n3. Write the processed or piped data to a new location on the file system\n\nInclude samson in your own module:\n\n    var samson = require('samson');\n    samson.run(['source/dir/**/*'], {\n        copyUnknown : true,\n        outputDir   : 'build/dir',\n        recursive   : true\n    });\n\n### doT\n\nSounds pretty simple right?\n\nThe unique part of Samson is in step #2. doT.js is both the fastest, and most open-ended JavaScript template engine I've found to date, and is the engine I believe to be best suited for the task I'm trying to achieve with Samson. If you are familiar with doT, skip to the next section, otherwise now would be a good time to visit http://olado.github.com/doT/\n\nInstall\n-----------\n\nWith npm this module prefers global installation:\n\n    npm i samson -g\n\nUsage\n-----------\n\n### Settings\n\nOne thing doT allows, is defining custom delimiters before compiling a string into a template, and with that I have defined different settings for the most common comment block delimiters.\n\nA quick look at these settings:\n- html\n    - tag start `<!--{`\n    - tag end `}-->`\n- js, css, php\n    - tag start `/*{`\n    - tag end `}*/`\n- txt (the most common and default format)\n    - tag start `#{`\n    - tag end `}#`\n\nA more detailed view of these settings can be found here http://drkibitz.github.com/node-samson/docs/0.3.1/Template.settingsByType.html\n\n### Example\n\nTake a look at the following example in `my-file.js`, that is not processed with Samson:\n\n    /* start */\n    /*{?argv.target !== 'release'}*/\n    var DEBUG = true;\n    /*{?}*/\n    /* end */\n\nProcess with Samson as `samson my-file.js` outputs:\n\n    /* start */\n\n    var DEBUG = true;\n\n    /* end */\n\nProcess with Samson as `samson my-file.js --target release` outputs:\n\n    /* start */\n\n\n    /* end */\n\n### Template Namespaces and Variables\n\nNotice the `argv` member accessible in the doT template. This object contains all of the script arguments parsed by the module optimist, and passed directly into the doT template.\n\nJust as within doT, the `def` object is special. Once a member property is set, it may not be changed. There is one `def` object defined for each file, and one file's template may not access another file's `def`.\n\nAdditionally but not limited to, enumerables set within `def` are passed directly to the template's runtime function as arguments. What this means is `/*{#def.FILE}*/`, may also be accessed as `/*{=FILE}*/`\n\nFor a more detailed view of the defailt members of `def`, please visit http://drkibitz.github.com/node-samson/docs/0.3.1/ResourceProcessor.def.html\n\n### More Usage Examples\n\nBe sure to to look at:\n\n    samson\n    samson -h\n    samson --help\n\nProcess a single file and output to console:\n\n    samson path/to/file\n\nProcess a single file and output to file system:\n\n    samson path/to/file -o path/to/directory\n\nProcess multiple files and output to file system:\n\n    samson path/to/file1 path/to/file2 path/to/file3 -o path/to/directory\n\nProcess single directory recursively and output to file system:\n\n    samson path/to/directory -o path/to/directory -R\n\nProcess files and directories recursively and output to file system:\n\n    samson path/to/dir1 path/to/file path/to/dir2 -o path/to/directory -R\n\nProcess matched files recursively and output to file system:\n\n    samson -i path/to/* -o path/to/other/directory -R\n\n","engines":{"node":">=0.8"},"_npmUser":{"name":"drkibitz","email":"drkibitz@gmail.com"},"keywords":["build","util","process"],"licenses":[{"url":"http://github.com/drkibitz/node-samson/raw/master/LICENSE","type":"MIT"}],"repository":{"url":"git://github.com/drkibitz/node-samson.git","type":"git"},"_npmVersion":"1.2.10","description":"A very useful build step; read any number of files, process them as JavaScript templates, and save output to another destination.","maintainers":[{"name":"drkibitz","email":"drkibitz@gmail.com"}],"dependencies":{"dot":"0.2.5","glob":"3.1.10","mkdirp":">=0.3.4","optimist":"0.3.4","mimeparse":">=0.1.4","mime-magic":">=0.4.2"},"preferGlobal":"true","readmeFilename":"README.md","devDependencies":{"vows":"0.6.2"},"_id":"samson@0.3.1","version":"0.3.1"}