Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils/docs/modules.md
diff options
context:
space:
mode:
Diffstat (limited to 'utils/docs/modules.md')
-rwxr-xr-xutils/docs/modules.md38
1 files changed, 0 insertions, 38 deletions
diff --git a/utils/docs/modules.md b/utils/docs/modules.md
deleted file mode 100755
index 6fe786f..0000000
--- a/utils/docs/modules.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Narwhal Modules
-===============
-
-Narwhal "scripts" are [ServerJS](https://wiki.mozilla.org/ServerJS) compatible modules, much like Python or Ruby modules. You do not have to use module pattern boilerplate; every module has its own local scope. You can get the exports object of another module by calling `require`.
-
- var file = require("file");
- file.isFile("foo.txt");
-
-Module identifiers for `require` come in three flavors: "top-level", "relative", and "absolute". In the above case, "file" is a "top-level" identifier, so it will load any module called "file.js" in the "lib" directory of whichever package comes first in the load path. Relative identifiers have "." or ".." as their first term, and terms are delimited with "/". So, in the "foo/bar" module, "require('./baz')" will load "foo/baz". Absolute module identifiers should not be used directly, but are produced when you execute a program module outside the module path. The module is identified by its fully-qualified path, starting with "/".
-
-You can export an object by assigning it to `exports`.
-
- exports.foo = function () {
- return "Hello";
- };
-
-In a module, you also get a `module` object that has `module.id` and `module.path` properties so you can inspect your own top-level module identifier, and the path of your own module file. You also get a `require.main` property that tells you the top-level module identifier of the module that started the program.
-
- if (require.id == require.main)
- main();
-
- var settings = require(require.main);
-
- var fs = require("file");
- var path = fs.path(module.path);
- var indexHtml = path.resolve("./template/index.html").read();
-
-Inside a module, you also get a `print` function and a `system` object. The `system` object is equivalent to the `system` module, but always available. It exports `stdin`, `stdout`, `stderr`, `args`, `platform`, `platforms`, `prefix`, and other handy routines.
-
-
-A Brief Tour
-============
-
-The main modules of the standard library are "system", "file", "io", and "os". There are also handy "json", "args", and "util" modules for a JSON codec, command line argument parsers, and utility functions.
-
-I have already introduced `system`. The "file" module implements functions like "open", "read", "write", "copy", "move", "list", and others. "os" exports commands like "system", "command", "exit", "popen", and "enquote" for shell args.
-