-
-
Notifications
You must be signed in to change notification settings - Fork 44
Nodejs build automation utility
Zeioth edited this page Nov 18, 2023
·
9 revisions
When compiler.nvim detects a package.json file in the current working directory, Telescope will be populated with all its script entries.
Create a package.json file in your working directory and copy/paste this:
{
"name": "hello-world-app",
"version": "1.0.0",
"scripts": {
"start": "node index.js"
}
}Now let's create the file we are building on the example above: Create index.js in the same directory.
console.log("Hello, World!");When you open the compiler you will see the option to run it

And this is the result

In the same way you can run hello world, you can execute any command necessary to build your program.
(optionally) You can define the next globals
| global | defaut value |
|---|---|
NODEJS_PACKAGE_MANAGER |
npm |
Example:
let g:NODEJS_PACKAGE_MANAGER='yarn'
Accepted values are 'npm' and 'yarn'
Globals persist between Neovim sessions.