A collection of reusable JavaScript utilities for Quartz products, with optional TypeScript support.
All functions are written in TypeScript and transpiled into ES2017 JavaScript (with type definitions).
npm i @quartz/js-utils
Import functions from the js-utils package, e.g.
import { arrayFromRange, resizeWPImage } from '@quartz/js-utils'
TypeScript hints are available if the file into which the functions are imported is a .ts
or .tsx
file.
Functions must be written in TypeScript whenever possible.
Export one function per file with a test suite (.test.js
).
- Export any new functions to
src/index.ts
- Add a test suite for any new functions
- Ensure tests pass (
npm t
) - Increment the
package.json
version usingnpm version
Use npm publish
to publish the package to npm. TypeScript will be built on publish (via npm run build
).