zet-lib
v6.1.1
Published
zet is a library that part of zet generator.
Downloads
877
Readme
Installation
npm install zet-libSafe installation
zet-lib includes some optional heavy features, such as browser/PDF automation and image processing.
If your app only needs the core helpers (database, cache, utilities, routers, mail, etc), a normal install is enough:
npm install zet-libIf you want to avoid browser downloads in CI/CD or server environments:
PUPPETEER_SKIP_DOWNLOAD=1 npm install zet-libOptional features
puppeteerUsed for browser/PDF style features.
Starting from
zet-lib@6, it is treated as optional during install.If you use a feature that needs Puppeteer and it is not installed,
zet-libwill throw a clear error message.To install it explicitly:
npm install puppeteer
sharpUsed for image processing/compression features.
It is optional because some environments do not need it or may have native install constraints.
To install it explicitly:
npm install --include=optional sharp
Performance note
zet-lib lazily loads its exports. This means require("zet-lib") will not immediately load all heavy modules.
Only the feature you access will load its underlying dependency tree.
Examples
Use only core utilities:
const { Util, connection } = require("zet-lib");Use Puppeteer-powered features:
const { puppeteer } = require("zet-lib");
// Make sure puppeteer is installed in your project first.