Skip to content

Commit

Permalink
brfs
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 18, 2014
1 parent ad79509 commit ec1bbfe
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ Simply save your transform to a file or make a package and then add it with
For more information about how streams work, check out the
[stream handbook](https://github.com/substack/stream-handbook).
## global transforms
# package.json
## browser field
Expand Down Expand Up @@ -803,14 +801,41 @@ node and browserify both support but discourage the use of `$NODE_PATH`.
## non-javascript assets
There are many
[browserify transforms](https://github.com/substack/node-browserify/wiki/browserify-transforms)
you can use to do many things. Commonly, transforms are used to include
non-javascript assets into bundle files.
### brfs
One way of including any kind of asset that works in both node and the browser
is brfs.
brfs uses static analysis to compile the results of `fs.readFile()` and
`fs.readFileSync()` calls down to source contents at compile time.
For example, this `main.js`:
``` js
var fs = require('fs');
var html = fs.readFileSync(__dirname + '/robot.html', 'utf8');
console.log(html);
```
applied through brfs would become something like:
```
var fs = require('fs');
var html = "<b>beep boop</b>";
console.log(html);
```
when run through brfs.
### hbsify
### jadeify
## publishing
# testing in node and the browser
## tape
Expand Down

0 comments on commit ec1bbfe

Please sign in to comment.