npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lad-tech/nsc-fast-install

v1.16.3

Published

Fast dependencies install for builds docker images of monorepo

Readme

📦 @lad-tech/nsc-fast-install

NPM

⚡️ Быстрая установка только нужных зависимостей при сборке микросервисов из большого моно-репозитория


❓ Зачем это нужно

В монорепозиториях:

  • Все зависимости обычно указываются в корневом package.json;
  • У сервисов нет своих node_modules;
  • Это удобно для разработки, но неэффективно для сборки контейнеров.

🔥 Проблема

При COPY node_modules в Docker попадают все зависимости, даже если сервис использует только малую часть.

📦 Это:

  • Увеличивает размер образов;
  • Замедляет сборку;
  • Усложняет отслеживание неиспользуемых пакетов.

💡 Решение

nsc-fast-install:

  • Работает после сборки TS → JS;
  • Анализирует start.js и все require()/import;
  • Выявляет реально используемые зависимости;
  • Копирует только нужные пакеты в dist/node_modules.

🚀 Установка

npm i @lad-tech/nsc-fast-install -D

🛠 Использование

# указываем точку входа
npx nsc-fast-install --entryPoint services/AuthService/start.ts

# или указываем папку сервиса (ищет main из package.json)
npx nsc-fast-install --service services/AuthService

📌 Пояснение про entryPoint и main

| Способ | Как работает | |-------------------|------------------------------------------------------------------------------| | --entryPoint | Путь до исходного TS-файла (start.ts) | | --service | Указывает папку, внутри которой будет найдён main в package.json | | main | Должен вести на dist/.../start.jsсобранный JS-файл, не .ts | | ❗️Важно | Анализ производится по JS, а не по TypeScript-коду |

Пример:

// services/AuthService/package.json
{
  "main": "dist/AuthService/start.js"
}

⚠️ Возможные дефекты

  1. Вы указали .ts, но не собрали проект

    Ошибка: outDir не найден или start.js не существует

    ✅ Решение: выполните tsc или npm run build перед вызовом

  2. main отсутствует или указывает на несуществующий файл

    ✅ Решение: добавьте main в package.json сервиса или используйте --entryPoint

  3. Некорректные импорты (например, с ошибками в RegExp)

    ✅ Убедитесь, что транспиляция прошла успешно и код валиден (analyze выполняется Babel'ом)


🔧 Опции CLI

| Флаг | Тип | Описание | |----------------------|----------|--------------------------------------------------------------------------| | --entryPoint | string | Путь до start.ts | | --service | string | Путь до папки сервиса | | --output | string | Папка назначения node_modules (по умолчанию — dist/) | | --exclude | string | Исключить сервисы, через , | | --tsconfig | string | Имя tsconfig.json | | --verbose | boolean| Расширенный лог | | --dryRun | boolean| Не копировать, только показать |