Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Idea] Add ability to import modules when supplying an expression #271

Open
squaremo opened this issue Oct 8, 2019 · 0 comments
Open

[Idea] Add ability to import modules when supplying an expression #271

squaremo opened this issue Oct 8, 2019 · 0 comments
Labels
good first issue Good for newcomers kind/enhancement New feature or request topic/cli

Comments

@squaremo
Copy link
Member

squaremo commented Oct 8, 2019

A couple of commands (jk run and jk transform) let you supply literal JavaScript to run, by interpolating the given code into a module, which is then loaded. A standard set of imports is included in the constructed module. For non-trivial uses, it would be handy to be able to specify more than the standard imports; e.g., to be able to import the merge module.

jk transform --import '@jkcfg/std/merge' -c 'v => merge.merge(v, { labels: { foo: "bar" } })'

The imported name would in general be the apparent basename of the import path; a mechanism for overriding that would be helpful, since occasionally module names collide.

@squaremo squaremo added good first issue Good for newcomers kind/enhancement New feature or request topic/cli labels Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request topic/cli
Projects
None yet
Development

No branches or pull requests

1 participant