Stub
Stub module.
Features
Features presented in this stub:
- ESLint.
- Babel.
- Terser.
- TypeScript support.
- ESM and CommonJS output.
- TypeScript declaration generation.
- JSDoc generation.
Note
Though you can import CommonJS files, it's highly recommended to use ESM
modules with .js
extension and TypeScript. Otherwise declaration
generation can produce broken declarations.
Install
Install via yarn:
yarn add stub
Install via npm:
npm i stub
Docs
Read the docs on GitHub pages.
Example
Import
CommonJS
const { stub, } = require('stub');
ES6
import { stub, } from 'stub';
Use
console.log(stub(false)); // 'bar'