Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

pownjs/modules

Repository files navigation

The project has moved to monorepo. See https://github.com/pownjs/pown for more information.

Follow on Twitter NPM Fury SecApps

Pown Modules

Modules is a utility library for working with PownJS modules. This library provides the core functionalities for the PownJS command-line framework.

Quickstart

Install this module from the root of your project:

$ npm install @pown/modules --save

Once done, list all installed pown modules like this:

const pownModules = require('@pown/modules')

pownModules.list((err, modules) => {
    if (err) {
        console.error(err)

        return
    }

    modules.forEach((module) => {
        // do something with module.config, module.package or module.realpath
    })
})

You can also use promises with async/await like this:

const pownModules = require('@pown/modules')

const modules = await pownModules.list()

modules.forEach((module) => {
    // do something with module.config, module.package or module.realpath
})

Pown Modules

A pown module is a regular NPM module which exports pown features and options via package.json or .pownrc.

Example: package.json

{
    "pown": {
        "main": "./main.js",
        "command": "./mytool.js",
        "commands": [
            "./mytool2.js"
        ],
        "transform": "./mytransform.js",
        "transforms": [
            "./mytransform2.js"
        ]
    }
}

Example: .pownrc

{
    "main": "./main.js",
    "command": "./mytool.js",
    "commands": [
        "./mytool2.js"
    ],
    "transform": "./mytransform.js",
    "transforms": [
        "./mytransform2.js"
    ]
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published