aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2016-09-03 23:26:31 +0200
committerAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2016-09-06 17:54:45 +0200
commit0111497fc98d5098f81bc749f77da5734add37bb (patch)
treec0d7e4da363639a4c68457d2f90e2eebc61796e8 /README.md
parent7d8dea3b2675f9d86ea15bb031b7fe166858d67e (diff)
downloadtracifyjs-0111497fc98d5098f81bc749f77da5734add37bb.tar.gz
tracifyjs-0111497fc98d5098f81bc749f77da5734add37bb.zip
Make all comment options in cli available in js api
Also removing more code within "loop" while at it.
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index 4f5b21a0..e0aa4ba9 100644
--- a/README.md
+++ b/README.md
@@ -849,8 +849,10 @@ which we care about here are `source_map` and `comments`.
#### Keeping comments in the output
In order to keep certain comments in the output you need to pass the
-`comments` option. Pass a RegExp or a function. If you pass a RegExp, only
-those comments whose body matches the regexp will be kept. Note that body
+`comments` option. Pass a RegExp, boolean or a function. Stringified options
+`all` and `some` can be passed too, where `some` behaves like it's cli
+equivalent `--comments` without passing a value. If you pass a RegExp,
+only those comments whose body matches the regexp will be kept. Note that body
means without the initial `//` or `/*`. If you pass a function, it will be
called for every comment in the tree and will receive two arguments: the
node that the comment is attached to, and the comment token itself.