@useprint/cli
v0.1.3
Published
A live preview of your documents right in your browser.
Readme
@useprint/cli
Preview, export, and build Useprint documents from the command line.
Install
npm install -D @useprint/cliGetting started
The CLI expects a documents/ directory by default.
documents/
invoice.tsx
static/Start the local preview app:
npx useprint devCommands
useprint dev
Starts the local preview app and watches your documents.
npx useprint devuseprint export
Renders your document components to HTML files in out/.
npx useprint exportuseprint build
Copies the preview app into .useprint and runs a production build.
npx useprint builduseprint start
Starts the built preview app from .useprint.
npx useprint startNotes
- Use
--dirto point the CLI at a different documents folder. - Use
--portwithdevto change the preview port. - Use
--outDirand--prettywithexportto control HTML output.
See also
@useprint/componentsfor authoring documents in React@useprint/renderfor the underlying React-to-HTML step
