This boilerplate repository creates a very simple web server for Node, while trying to exemplify many "best practices" for developing a Node/JS package.
Please see the accompanying blog post about this project to learn more about what is going on!
Repository provided by Anvil
Anvil provides easy APIs for all things paperwork.
- PDF filling API - fill out a PDF template with a web request and structured JSON data.
- PDF generation API - send markdown or HTML and Anvil will render it to a PDF.
- Etch e-sign with API - customizable, embeddable, e-signature platform with an API to control the signing process end-to-end.
- Anvil Workflows (w/ API) - Webforms + PDF + e-sign with a powerful no-code builder. Easily collect structured data, generate PDFs, and request signatures.
Learn more on our Anvil developer page.
This package isn't really meant to be downloaded from npm
and used as a boilerplate in your projects (or globally). Rather, the repository should be cloned from Github and played around with from there:
cd /path/to/projects
git clone https://github.com/anvilco/best-practices-node.git
cd best-practices-node
yarn install
There are a few interesting commands in this project to explore:
-
yarn clean:build
: Will delete thedist/
directory and transpile the source code insrc/
to thedist/
directory. -
yarn start
: Will run the transpiled code in thedist/
directory. -
yarn develop
: Will transpile the source code, start the server and then watch for source file changes. When a source file change is detected, the code will be transpiled and restarted. -
yarn test
: Transpile the source code and then run the test suite...which doesn't really do much right now. -
yarn test:watch
: Similar toyarn test
, but it will transpile and restart the tests after code changes. -
yarn my-script
: Will run the scriptscripts/my-script.js
usingbabel-node
to transpile it on-the-fly. -
yarn pack
: Will zip up the package to show you what would be included if you were to publish things to NPM.