Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup pass + loader example + README update
- Loading branch information
Showing
15 changed files
with
137 additions
and
262 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
console.log("obsolete script: use _node instead."); | ||
require("streamline/lib/compiler/command").run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.log('hello ...'); | ||
setTimeout(_, 1000); | ||
console.log('... world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// !example | ||
/// | ||
/// # Streamline loader example | ||
/// | ||
/// The loader module must be a vanilla Javascript or CoffeeScript module | ||
/// (`.js` or `.coffee` extension), not a streamline.js source because | ||
/// it gets loaded before the extensions have been registered. | ||
/// | ||
/// The loader module must register the streamline file extensions: | ||
require('streamline/lib/compiler/register').register({ | ||
fibers: false, | ||
cache: true, | ||
verbose: true, | ||
}); | ||
/// Once the extensions have been registered, the loader can require a streamline | ||
/// module | ||
require('./hello') | ||
/// ## Running it | ||
/// | ||
/// ``` sh | ||
/// node streamline/examples/runner/runner | ||
/// ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Streamline loader example | ||
|
||
The loader module must be a vanilla Javascript or CoffeeScript module | ||
(`.js` or `.coffee` extension), not a streamline.js source because | ||
it gets loaded before the extensions have been registered. | ||
|
||
The loader module must register the streamline file extensions: | ||
|
||
``` javascript | ||
require('streamline/lib/compiler/register').register({ | ||
fibers: false, | ||
cache: true, | ||
verbose: true, | ||
}); | ||
``` | ||
|
||
Once the extensions have been registered, the loader can require a streamline | ||
module | ||
|
||
``` javascript | ||
require('./hello') | ||
``` | ||
|
||
|
||
## Running it | ||
|
||
``` sh | ||
node streamline/examples/runner/runner | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.