Skip to content

Standard way to write a message after package install #6971

@ark120202

Description

@ark120202

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

There are more and more packages that add a postinstall script to write some message after installing a package, usually suggesting to support package's author. There are few issues with this:

  • Yarn collapses scripts' stdout, so these messages don't get displayed at all (related to Postinstall script is not being executed  #5476)

  • Since there are no any guidelines, instead of simply logging message it might do web requests, require huge dependencies, or write a lot of text, seriously slowing install process

  • Since usually modules don't have any scripts I remember all these modules, so noticing a new module makes me check what exactly is being executed. If more modules would adopt that practice, a new module appearing there won't be a surprise, but it actually might be a malicious script

What is the expected behavior?

Provide a new field in package.json (for example installMessage) to specify a message that would be printed after installing a module. Additionally, it may add a limit to the length of logged message and add a config option to opt-out of it.

Thread on npm community

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions