@pnxdxt/pkg-template
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@pnxdxt/pkg-template

Small js package I use to help me to create npm packages

XO code style GitHub workflow status npm bundle size npm downloads

Install

$ npm install pkg-template

Import

This package is pure ESM. It cannot be require()'d from CommonJS.

Use import foo from 'foo' instead of const foo = require('foo') to import the package.

// Load entire build
import * as pkgName from 'pkg-template';

// Load by method
import {main} from 'pkg-template';

If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).

You also need to make sure you're on the latest minor version of Node.js. At minimum Node.js 12.20, 14.14, or 16.0.

Read more here: sindresorhus/esm-package

Usage

main([1,2,3], (element) => typeof element === 'string');
//=> false

main(['1', '2', '3'], (element) => typeof element === 'string');
//=> true

License

MIT © pnxdxt

Install

DownloadsWeekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

9.6 kB

Total Files

10

Last publish

Collaborators

  • pnodet