Add Javascript Support
See original GitHub issueInstead of JSON and YAML, I’d prefer to use a JavaScript module. For example, instead of this JSON:
{
"scripts": {
"start": "deno run --allow-net server.ts",
"test": "deno test --allow-net server_test.ts"
}
}
or this YAML:
# scripts.yaml
scripts:
start: deno run --allow-net server.ts
test: deno test --allow-net server_test.ts
I prefer this:
let options = {};
options.scripts = {};
options.scripts.start = "deno run --allow-net server.ts";
options.scripts.test = "deno test --allow-net server_test.ts";
export options;
Granted, my preference is more verbose. However, nothing is more flexible. You could do anything you wanted (programmatically) within this file and Velociraptor should only care about the object that gets exported at the end.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Set.prototype.add() - JavaScript - MDN Web Docs - Mozilla
The add() method inserts a new element with a specified value in to a Set object, if there isn't an element with the...
Read more >How to enable JavaScript in Windows - Microsoft Support
This article describes step for users to allow all Web sites in the Internet zone to run JavaScript in Internet Explorer, Chrome, and...
Read more >Add JavaScript - Qualtrics
Click the question you'd like to add JavaScript to. selecting a question and then clicking Javascript; In the Question behavior section, select JavaScript....
Read more >JavaScript Programming with Visual Studio Code
To define a basic JavaScript project, add a jsconfig.json at the root of your workspace: ... VS Code comes with great debugging support...
Read more >JavaScript | IntelliJ IDEA Documentation - JetBrains
On the JavaScript page, click the Browse button · Click Add · From the Language list, choose the language version for the files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Lonniebiz no, we’re supporting only
.ts
for the reasons discussed above but you can still write JS in TS files since they’re sub/supersets of one another. Also, when this is implemented you will get code assistante for the configuration object without needing to manually add types.That is true and inevitable. To avoid perm errors the install command must give all perms (which seems fair).
Yup. I’ve just added that to the PR.
Maybe it is better to let the user know that the config scripts are compiled at runtime so they should expect compile logs from Deno. Though it won’t actually interrupt other logs as it is the compiled before any of the configs is processed.
Overall, I think this would be a good feature to introduce as it provides a more dynamic way to make config files.