Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 657 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 657 Bytes

quartz

quartz is a simple JavaScript transform import utility that allows you to evaluate code with ESM imports and exports as well as do transforms on them.

installation

npm install @uwu/quartz

example

// input.js
import { multiplyByTwo } from "dependency";

export default multiplyByTwo(5);

// run it with quartz!
import quartz from "quartz";
import provideDep from "quartz-plugin-provide-dep";

const ten = await quartz(inputJsCode, {
  plugins: [
    provideDep({
      dependency: {
        multiplyByTwo: (i) => i * 2,
      },
    }),
  ],
}); // this runs the code and handles the imports and exports automatically!