Today I Learned - Rocky Kev

TIL how to run npm that's inside a child folder

POSTED ON:

TAGS:

└── Root folder/
    ├── random-folder/
    │   └── files
    ├── app/
    │   ├── /dist
    │   ├── /src
    │   ├── webpack.js
    │   └── package.json
    ├── another-folder/
    │   └── other files
    ├── ...
    └── package.json

  1. You're in your root folder.
  2. You want to run the app/package.json
  3. How?
    "scripts": {
        "postinstall": "npm install --prefix ./app",
        "build:app": "npm run build --prefix ./app",
        "serve:app": "npm run serve --prefix ./app"
    },

Related TILs

Tagged:

TIL types of malicious npm attacks

In the case of ionicons, the miscreants published 18 versions containing malicious form-stealing code; for example, icon-package (according to NPM download stats) has over 17,000 downloads. Other typo-squatting examples include umbrellaks instead of umbrellajs and so on.

TIL malware in node_modules

The very first line fetches the victim's country code using their IP address. If the victim is from Russia, Ukraine, Belarus, or Kazakhstan, then the malware exits early.

TIL NPM Christmas

This cute binary from NPM lets you really kick off the holidays.