Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added embedding section

  • Loading branch information...
commit fdcf32fe6f67e8822e138cf8124d78d8dae59a2b 1 parent 4eabdc6
@olegp authored
Showing with 9 additions and 254 deletions.
  1. +9 −1 README.md
  2. +0 −253 doc/fs/index.html
View
10 README.md
@@ -72,12 +72,20 @@ You can also run individual tests or sets of tests, for example:
### Benchmarks
-Although `common-node` is optimized for developer efficiency rather than performance, a number of benchmarks are included in [common-node/benchmarks](https://github.com/olegp/common-node/tree/master/benchmarks). A `common-node` version and an asynchronous version using Connect of each benchmark are provided.
+Although `common-node` is optimized for development efficiency rather than performance, a number of benchmarks are included in [common-node/benchmarks](https://github.com/olegp/common-node/tree/master/benchmarks). A `common-node` version and an asynchronous version using Connect of each benchmark are provided.
* hello - returns a dynamically generated string; common is around 50% of plain, 66% of connect
* static - returns a file served from the file system; common is a few percent faster than connect
* http - makes a request to google and returns the response
+### Embedding
+
+To use the package in your async app, you will need to:
+
+ * run your app with `node-fibers` instead of `node`
+ * change the way in which you require modules from `var io = require('io');` to `var io = require('common-node').io;`
+ * if you want to avoid requiring as above, you will need to run the following on initialization: `require.paths.push(path.dirname(require.resolve('common-node')));`
+
### Contributing
To contribute to this project, you can start by trying to run the tests on your system and posting your results (even if all tests pass) on the issue tracker.
View
253 doc/fs/index.html
@@ -1,253 +0,0 @@
-<!DOCTYPE html >
-
-<html lang="de" dir="ltr">
-<head>
- <title>fs - Common Node</title>
- <link rel="shortcut icon" href="http://ringojs.org/favicon.ico" type="image/x-icon" />
- <link rel="icon" href="http://ringojs.org/favicon.ico" type="image/x-icon" />
- <link rel="stylesheet" href="../static/style.css" />
- <link rel="stylesheet" href="../static/jsdoc.css" />
-<script type="text/javascript" src="../static/jquery.js"></script>
-<script type="text/javascript" src="../static/jsdoc.js"></script>
-<script>
-$(document).ready(jsdocSetup);
-</script>
-
-</head>
-
-<body>
-<div class="wrap">
-
- <div class="main">
- <div class="content">
- <h1 class="modulename">Module fs</h1>
- <div class="fileoverview">
- <p>File and path related functionality as
-defined in <a href="http://wiki.commonjs.org/wiki/Filesystem/A">CommonJS
-Filesystem/A</a> .</p>
-
-
- </div>
-
- <div class="classoverview">
-
- <div>
- <h3>Functions</h3>
- <ul class="propertyoverview">
- <li>
- <a href="#copy" class="jsdoc-title"> copy</a>(from, to)
- </li>
- <li>
- <a href="#open" class="jsdoc-title"> open</a>(path, options)
- </li>
- <li>
- <a href="#openRaw" class="jsdoc-title"> openRaw</a>(path, mode, permissions)
- </li>
- <li>
- <a href="#read" class="jsdoc-title"> read</a>(path, options)
- </li>
- <li>
- <a href="#write" class="jsdoc-title"> write</a>(path, content, options)
- </li>
- </ul>
- </div>
- <div class="classes">
- </div>
- </div>
- <hr/>
- <div class="details">
- <!-- tpl-docitem -->
- <div>
- <div class="docitem" docitem="copy">
- <h3>
- <span class="itemtitle"><a id="copy" href="#copy" class="itemtitle itemname">copy</a></span>
- <span class="itemtitle light">(from, to)</span></h3>
- <div>
- <p>Read data from one file and write it into another using binary mode.</p>
-
-
- </div>
- <div>
- <h4>Parameters</h4>
- <table>
- <tr>
- <td></td>
- <td class="paramname">from</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">to</td>
- <td></td>
- </tr>
- </table>
- </div>
- </div>
- <hr/>
- </div>
-
- <!-- tpl-docitem -->
- <div>
- <div class="docitem" docitem="open">
- <h3>
- <span class="itemtitle"><a id="open" href="#open" class="itemtitle itemname">open</a></span>
- <span class="itemtitle light">(path, options)</span></h3>
- <div>
- <p>Open an IO stream for reading/writing to the file corresponding to the given
-path.</p>
-
-
- </div>
- <div>
- <h4>Parameters</h4>
- <table>
- <tr>
- <td></td>
- <td class="paramname">path</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">options</td>
- <td></td>
- </tr>
- </table>
- </div>
- </div>
- <hr/>
- </div>
-
- <!-- tpl-docitem -->
- <div>
- <div class="docitem" docitem="openRaw">
- <h3>
- <span class="itemtitle"><a id="openRaw" href="#openRaw" class="itemtitle itemname">openRaw</a></span>
- <span class="itemtitle light">(path, mode, permissions)</span></h3>
- <div>
-
-
-
- </div>
- <div>
- <h4>Parameters</h4>
- <table>
- <tr>
- <td></td>
- <td class="paramname">path</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">mode</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">permissions</td>
- <td></td>
- </tr>
- </table>
- </div>
- </div>
- <hr/>
- </div>
-
- <!-- tpl-docitem -->
- <div>
- <div class="docitem" docitem="read">
- <h3>
- <span class="itemtitle"><a id="read" href="#read" class="itemtitle itemname">read</a></span>
- <span class="itemtitle light">(path, options)</span></h3>
- <div>
- <p>Open, read, and close a file, returning the file's contents.</p>
-
-
- </div>
- <div>
- <h4>Parameters</h4>
- <table>
- <tr>
- <td></td>
- <td class="paramname">path</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">options</td>
- <td></td>
- </tr>
- </table>
- </div>
- </div>
- <hr/>
- </div>
-
- <!-- tpl-docitem -->
- <div>
- <div class="docitem" docitem="write">
- <h3>
- <span class="itemtitle"><a id="write" href="#write" class="itemtitle itemname">write</a></span>
- <span class="itemtitle light">(path, content, options)</span></h3>
- <div>
- <p>Open, write, flush, and close a file, writing the given content. If
-content is a binary.ByteArray or binary.ByteString, binary mode is implied.</p>
-
-
- </div>
- <div>
- <h4>Parameters</h4>
- <table>
- <tr>
- <td></td>
- <td class="paramname">path</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">content</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td class="paramname">options</td>
- <td></td>
- </tr>
- </table>
- </div>
- </div>
- <hr/>
- </div>
-
- </div>
- </div>
- </div>
-
-
-
- <div class="menu" style="margin-top: 1em; font-size: 13px;">
- <p>
- <a class="repositoryname" href="../index.html">Common Node </a>
- </p>
-
- Filter:<br />
- <input id="jsdoc-leftnavsearch" type="search" size="14">
- <ul class="jsdoc-leftnav leftnav">
- <li><a href="../assert/index.html"> assert </a></li>
- <li><a href="../binary/index.html"> binary </a></li>
- <li><a href="../fs/index.html"> fs </a></li>
- <li><a href="../httpclient/index.html"> httpclient </a></li>
- <li><a href="../io/index.html"> io </a></li>
- <li><a href="../jsgi/index.html"> jsgi </a></li>
- <li><a href="../system/index.html"> system </a></li>
- <li><a href="../test/index.html"> test </a></li>
- </ul>
-
-
-</div>
-</div>
-</body>
-</html>
-
-
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.