inline-js-default-resources
v0.1.0
Published
Builtin resources for inline-js
Downloads
38
Readme
inline-js-default-resources
This repository contains the builtin resources for inline-js
Installation
npm install inline-js-default-resources
Usage
const {createInliner} = require("inline-js-core");
const {RESOURCES} = require("inline-js-default-resources");
const inliner = createInliner();
RESOURCES.forEach(inliner.resource.add);
RESOURCES
This repository contains following resources:
file
: It reads the content from a file path, which may be relative to the file which requires the resource.The result could be a utf8 string or a
Buffer
, depending on the extension of the file (see is-binary-path).text
: Likefile
, but the result is always a utf8 string.raw
: Likefile
, but the result is always aBuffer
.cmd
: Execute a command and read the stdout as a utf8 string. You may pass the second argument which represent the encoding (default:utf8
). Passingbuffer
to get rawBuffer
object.Current date: $inline("cmd:date /t")
PATH_LIKE
A set of resource type. These resources use a filepath as their first argument, including file
, text
, and raw
.
Changelog
0.1.0 (Jun 27, 2018)
- First release.