Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-fasly-postinstall

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-fasly-postinstall

Specification package manager

  • 0.0.5
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm-fasly-postinstall

The hook about preinstall of npm behaves inconsistently across package managers.

The existing solution (only-allow) is not working well.

The npm-fasly-postinstall goal is to fix them.

Installation

  yarn add npm-fasly-postinstall

usage

Add a postinstall script to your project's package.json.

If you want to force npm|cnpm|pnpm|yarn, add:
(If you want to smooth out the difference, you also need to add it in the startup script)

{
  "scripts": {
    "postinstall": "npm-fasly-postinstall --PM yarn --server install",
    "start": "npm-fasly-postinstall --server start && vite server or other"
  }
}

params

  • PM

    Set the package manager

  • server

    Specifies whether to run in the 'postinstall' or 'start' phase

  • lang

    Set the language category for error messages to be output , Default to Chinese

Sample environment

node v14.19.0
npm v8.11.0
yarn v1.22.19
pnpm v7.2.7
cnpm v9.0.1

Testing process

This is the testing process after the development is complete

You just have to choose one or the other

Let's take cnpm for example

{
  "scripts": {
    "postinstall": "npm-fasly-postinstall --PM cnpm --server install",
    "start": "npm-fasly-postinstall --server start"
  }
}
  • step 1
    pnpm i | yarn add | npm i
  • step 2
    cnpm i
  • step 3
    cnpm i lodash
  • step 4
    cnpm start
  • step 5
    yarn add moment
  • step 6
    cnpm start
  • step 7
    pnpm i jquery
  • step 8
    cnpm start
  • step 9
    pnpm uninstall jquery
    or
    remove lock
  • step 10
    cnpm start

License

MIT

Keywords

FAQs

Package last updated on 16 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc