usage.txt 1.6 KB

123456789101112131415161718192021222324
  1. EJS Embedded JavaScript templates
  2. {Usage}: ejs [options ...] template-file [data variables ...]
  3. {Options}:
  4. -o, --output-file FILE Write the rendered output to FILE rather than stdout.
  5. -f, --data-file FILE Must be JSON-formatted. Use parsed input from FILE as data for rendering.
  6. -i, --data-input STRING Must be JSON-formatted and URI-encoded. Use parsed input from STRING as data for rendering.
  7. -m, --delimiter CHARACTER Use CHARACTER with angle brackets for open/close (defaults to %).
  8. -p, --open-delimiter CHARACTER Use CHARACTER instead of left angle bracket to open.
  9. -c, --close-delimiter CHARACTER Use CHARACTER instead of right angle bracket to close.
  10. -s, --strict When set to `true`, generated function is in strict mode
  11. -n --no-with Use 'locals' object for vars rather than using `with` (implies --strict).
  12. -l --locals-name Name to use for the object storing local variables when not using `with`.
  13. -w --rm-whitespace Remove all safe-to-remove whitespace, including leading and trailing whitespace.
  14. -d --debug Outputs generated function body
  15. -h, --help Display this help message.
  16. -V/v, --version Display the EJS version.
  17. {Examples}:
  18. ejs -m $ ./test/fixtures/user.ejs -f ./user_data.json
  19. ejs -m $ ./test/fixtures/user.ejs name=Lerxst
  20. ejs -p [ -c ] ./template_file.ejs -o ./output.html
  21. ejs -n -l _ ./some_template.ejs -f ./data_file.json
  22. ejs -w ./template_with_whitspace.ejs -o ./output_file.html