Jsenv is a suite of tools that can be used in projects involving JavaScript.
@jsenv/core
goal is too provide the following tools:
- dev server; a server for source files
- build; generate an optimized version of source files into a directory
- build server; a server for build files
- test runner; execute all test files at once
It favors standards and simplicity.
As a result it can be enjoyed by people without much experience in tooling or seeking for simple tools without hidden complexities
- Test files are executed like standard files
- Isolated environment for each test file
- Execute tests in multiple browsers: Chrome, Safari, Firefox
- Large browser support during dev. Because some people might be happy to use an other browser than the latest chrome during dev. Moreover it is useful to reproduce bug specific to certain browsers.
- Large browser support after build. Because some product still needs to support old versions of Firefox, Chrome and Safari.
- Single set of files after build. Because a single one is simpler to properly support in every aspects.
- Versioning during build is robust and avoids cascading hash changes↗
- Advanced support of top level await, allowing to use it everywhere
- Advanced support of web workers including worker type module
- Unlock js module features on a classic
<script>
.
A demo is a project pre-configured with jsenv.
The following command can be used to install and try a demo:
npm create jsenv@latest
It will prompt to choose one of the available demo:
? Select a demo: › - Use arrow-keys. Return to submit.
❯ web
web-components
web-react
web-preact
node-package
Selecting "web" will copy create-jsenv/demo-web files into a directory:
✔ Select a demo: › web
✔ copy demo files into "[...]jsenv-demo-web/" (done in 0.1 second)
----- commands to run -----
cd jsenv-demo-web
npm install
npm start
---------------------------
After running the suggested commands the demo is ready.
The demo contains preconfigured scripts:
npm run dev
: starts a server for source files; Documented in B) Dev.npm run build
: generate build files; Documented in C) Build.npm run build:serve
: start a server for build files; Documented in C) Build#how-to-serve-build-files.npm run test
: execute test files; Documented in D) Test.