Using Suchjs in Node environment
- 1. Install the library via npm
-
# Use yarn yarn add suchjs # Use npm npm install --save suchjs # Use pnpm pnpm add suchjs
- 2. Use in the project
-
// 1. ESM mode import globalSuch from "suchjs"; console.log(globalSuch.as(":string")); // If you need namespace import { createNsSuch } from "suchjs"; const mySuch = createNsSuch("my"); console.log(mySuch.as(":string")); // 2. CMD mode const globalSuch = require("suchjs").default; console.log(globalSuch.as(":string")); // If you need namespace const createNsSuch = require("suchjs").createNsSuch; const mySuch = createNsSuch("my"); console.log(mySuch.as(":string"));