1.8.0 ā€¢ Published 1 year ago

genpack v1.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Description

GenPack is a package generator for npm


Installation

npm install genpack -g

Usage

genpack

Quick Start

To quickly generate an npm module, create a cjs folder + an index.cjs file.

e.g.

šŸ“ package-root                
ā”‚
ā””ā”€ā”€ā”€šŸ“ cjs
     ā”‚
     ā””ā”€ā”€ā”€ šŸ“ index.cjs

šŸ“ index.cjs content ā†“

const add = function (a, b)
{
    return a + b;
}
module.exports.add = add;

From the CLI, go to the directory, then run:

šŸ’» ā†“

$ genpack

You will obtain an NPM hybrid package working with cjs, esm and typescript.


Options

OptionsdefaultExpectDescription
--version, -vfalsebooleanDisplay GenPack version
--repostringRepo URL
--clifalsebooleanTo have the generated module support CLI
--authorstringAuthor name
--emailstringAuthor email
--licensemit, cc0_1, bsd, isc, bsd-2-clauseTo generate a license for the module

Commands

To update the esm/index.mjs file after modifying the cjs/index.cjs file, run:

$ npm run genpack:build:esm

To update the tests after modifying unit-test.cjs:

$ npm run genpack:build:test

To run the tests:

$ npm run genpack:test
1.7.2

1 year ago

1.8.0

1 year ago

1.7.1

1 year ago

1.6.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago