Permalink
Browse files

Update readme

  • Loading branch information...
1 parent 0aac8cd commit 6e0a9534c36cb9caaf35863fa2b148cb023e09e9 @isaacs isaacs committed Jun 11, 2012
Showing with 33 additions and 2 deletions.
  1. +33 −2 README.md
View
@@ -38,6 +38,37 @@ Reads the JSON file and does the things.
See `man 5 package.json` or `npm help json`.
+## readJson.log
+
+By default this is a reference to the `npmlog` module. But if that
+module can't be found, then it'll be set to just a dummy thing that does
+nothing.
+
+Replace with your own `{log,warn,error}` object for fun loggy time.
+
+## readJson.extras(file, data, cb)
+
+Run all the extra stuff relative to the file, with the parsed data.
+
+Modifies the data as it does stuff. Calls the cb when it's done.
+
+## readJson.extraSet = [fn, fn, ...]
+
+Array of functions that are called by `extras`. Each one receives the
+arguments `fn(file, data, cb)` and is expected to call `cb(er, data)`
+when done or when an error occurs.
+
+Order is indeterminate, so each function should be completely
+independent.
+
+Mix and match!
+
+## readJson.cache
+
+The `lru-cache` object that readJson uses to not read the same file over
+and over again. See
+[lru-cache](https://github.com/isaacs/node-lru-cache) for details.
+
## Other Relevant Files Besides `package.json`
Some other files have an effect on the resulting data object, in the
@@ -107,7 +138,7 @@ The important thing is that it starts with `/**package`, and ends with
`**/`. If the package.json file exists, then the index.js is not
parsed.
-## `{directories.man}/*.[0-9]`
+### `{directories.man}/*.[0-9]`
If there is not already a `man` field defined as an array of files or a
single file, and
@@ -118,7 +149,7 @@ Any valid manpages found in that directory will be assigned to the `man`
array, and installed in the appropriate man directory at package install
time, when installed globally on a Unix system.
-## `{directories.bin}/*`
+### `{directories.bin}/*`
If there is not already a `bin` field defined as a string filename or a
hash of `<name> : <filename>` pairs, then the `directories.bin`

0 comments on commit 6e0a953

Please sign in to comment.