sioux-ui-switch
Version:
UISwitch module for sioux
46 lines (45 loc) • 3.24 kB
JSON
{
"name": "brfs",
"version": "0.0.4",
"description": "browserify fs.readFileSync() static asset inliner",
"main": "index.js",
"bin": {
"brfs": "bin/cmd.js"
},
"dependencies": {
"through": "~2.2.0",
"falafel": "~0.1.6",
"escodegen": "0.0.17"
},
"devDependencies": {
"tap": "~0.4.0",
"browserify": "~2.3.1"
},
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/substack/brfs.git"
},
"homepage": "https://github.com/substack/brfs",
"keywords": [
"browserify",
"fs",
"readFileSync",
"plugin",
"static",
"asset",
"bundle",
"base64"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"readme": "# brfs\n\nbrowserify fs.readFileSync() static asset inliner\n\n[](http://travis-ci.org/substack/brfs)\n\nThis module is a plugin for [browserify](http://browserify.org) to parse the AST\nfor `fs.readFileSync()` calls so that you can inline file contents into your\nbundles.\n\nEven though this module is intended for use with browserify, nothing about it is\nparticularly specific to browserify so it should be generally useful in other\nprojects.\n\n# example\n\nfor a main.js:\n\n``` js\nvar fs = require('fs');\nvar html = fs.readFileSync(__dirname + '/robot.html');\nconsole.log(html);\n```\n\nand a robot.html:\n\n``` html\n<b>beep boop</b>\n```\n\nfirst `npm install brfs` into your project, then:\n\n## on the command-line\n\n```\n$ browserify -t brfs example/main.js > bundle.js\n```\n\nnow in the bundle output file,\n\n``` js\nvar html = fs.readFileSync(__dirname + '/robot.html');\n```\n\nturns into:\n\n``` js\nvar html = \"<b>beep boop</b>\\n\";\n```\n\n## or with the api\n\n``` js\nvar browserify = require('browserify');\nvar fs = require('fs');\n\nvar b = browserify('example/main.js');\nb.transform('brfs');\n\nb.bundle().pipe(fs.createWriteStream('bundle.js'));\n```\n\n# methods\n\nbrfs looks for `fs.readFileSync(pathExpr, enc='utf8')` calls.\n\nThe `pathExpr` function is evaluated as an expression with `__dirname` and\n`__filename` variables available.\n\nIf you want differently-encoded file contents for your inline content you can\nset `enc` to `'base64'` or `'hex'`.\n\nIf you want to use this plugin directly, not through browserify, the api\nfollows.\n\n``` js\nvar brfs = require('brfs')\n```\n\n## var tr = brfs(file)\n\nReturn a through stream `tr` inlining `fs.readFileSync()` file contents\nin-place.\n\n# usage\n\nA tiny command-line program ships with this module to make debugging easier.\n\n```\nusage:\n\n brfs file\n \n Inline `fs.readFileSync()` calls from `file`, printing the transformed file\n contents to stdout.\n\n brfs\n brfs -\n \n Inline `fs.readFileSync()` calls from stdin, printing the transformed file\n contents to stdout.\n\n```\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install brfs\n```\n\nthen use `-t brfs` with the browserify command or use `.transform('brfs')` from\nthe browserify api.\n\n# license\n\nMIT\n",
"_id": "brfs@0.0.4",
"_from": "brfs"
}