Skip to content

avoid parsing argv when using as a lib #8

@missinglink

Description

@missinglink

when requiring this lib for use in an external codebase the lib/oa.js file calls minimist from the module scope to process process.argv.

this in turn leads to requiring minimist as a runtime dep when not using the CLI interface.

https://github.com/openaddresses/lib/blob/master/oa.js#L11-L18

one potential solution is to use something like this if (require.main === module) { to distinguish between execution and inclusion.

alternatively this functionality could be moved to lib/src/cli.js and only run when the CLI interface is executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions