From 1b55010a04be4401abc2aad12984e1eb337222f2 Mon Sep 17 00:00:00 2001 From: koichik Date: Thu, 13 Oct 2011 17:06:27 +0900 Subject: [PATCH] docs: added .json modules. --- doc/api/modules.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 19b5649701..1d85c9dc89 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -98,10 +98,11 @@ return the built in HTTP module, even if there is a file by that name. ### File Modules If the exact filename is not found, then node will attempt to load the -required filename with the added extension of `.js`, and then `.node`. +required filename with the added extension of `.js`, `.json`, and then `.node`. -`.js` files are interpreted as JavaScript text files, and `.node` files -are interpreted as compiled addon modules loaded with `dlopen`. +`.js` files are interpreted as JavaScript text files, and `.json` files are +parsed as JSON text files. `.node` files are interpreted as compiled addon +modules loaded with `dlopen`. A module prefixed with `'/'` is an absolute path to the file. For example, `require('/home/marco/foo.js')` will load the file at