[Pkg-javascript-commits] [node-module-deps] 175/444: document transformKey variants
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:47:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 0f212d4047d4b8566a0ec23de9d96f9314e72dc9
Author: James Halliday <mail at substack.net>
Date: Sun Feb 9 15:10:25 2014 -0800
document transformKey variants
---
readme.markdown | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/readme.markdown b/readme.markdown
index 5959edf..dfa34c4 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -130,6 +130,44 @@ in their package.json at the `opts.transformKey` path. These transformations
only apply to the files directly in the module itself, not to the module's
dependants nor to its dependencies.
+## package.json transformKey
+
+Transform keys live at a configurable location in the package.json denoted by
+the `opts.transformKey` array.
+
+For a transformKey of `['foo','bar']`, the transformKey can be a single string
+(`"fff"`):
+
+``` json
+{
+ "foo": {
+ "bar": "fff"
+ }
+}
+```
+
+or an array of strings (`["fff","ggg"]`):
+
+``` json
+{
+ "foo": {
+ "bar": ["fff","ggg"]
+ }
+}
+```
+
+If you want to pass options to the transforms, you can use a 2-element array
+inside of the primary array. Here `fff` gets an options object with `{"x":3}`
+and `ggg` gets `{"y":4}`:
+
+``` json
+{
+ "foo": {
+ "bar": [["fff",{"x":3}],["ggg",{"y":4}]]
+ }
+}
+```
+
# install
With [npm](http://npmjs.org), to get the module do:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list