Skip to content

Declare os to prevent installation on non-Windows systems #286

@TrevorBurnham

Description

@TrevorBurnham

I have a package that conditionally requires registry-js on Windows only. However, it's installed in node_modules regardless of platform.

This inefficiency could be addressed if registry-js declared in its package.json that it only runs on Windows:

"os": ["win32"],

Then consumers could declare it in optionalDependencies and it would only be installed on Windows devices.

Important: This would be a breaking change requiring a new major version, because npm would throw an error on non-Windows devices if this package is declared as a non-optional dependency.

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