Command line for Voodoo.js, the HTML-first JavaScript framework.
npx voodoojs-cli init my-pageThat writes a working page and nothing else: no build step, no config file, no dependencies to install. Open the file in a browser and it runs.
npx voodoo runs a different package. voodoo on npm belongs to an unrelated,
abandoned project from 2012 and crashes on any modern Node with
TypeError: path.existsSync is not a function. This CLI has always been a
separate thing; it is voodoojs-cli, matching voodoojs, the library.
npx voodoojs-cli init my-page # a ready-to-open project
npx voodoojs-cli build --modules=core,directives,http # a bundle with only what you use
npx voodoojs-cli add card # copy a component into your project
npx voodoojs-cli info # list the modules and their sizesinit works anywhere. build, add and info read the library's own source,
so they need voodoojs present in the project:
npm install voodoojs
npx voodoojs-cli infoRun inside the Voodoo.js repository, they find the workspace copy instead.
Assembles a bundle from the modules you name, with esbuild.
npx voodoojs-cli build --modules=core,directives
npx voodoojs-cli build --modules=core,directives,http,forms --out=dist/app.jsThe point is size. The published voodoo.min.js is 83 KB gzipped and the full
build is 130 KB, because they carry everything. A page that only needs
reactivity and a few directives does not have to pay for charts, the router and
the inspector.
Run npx voodoojs-cli info to see what each module costs before choosing.
Node 18 or newer. esbuild is the only dependency, and only build uses it.
MIT