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 🙏

© 2024 – Pkg Stats / Ryan Hefner

svecchiator

v4.0.5

Published

An npm module to brutally update a Node.js project's dependencies

Downloads

56

Readme

Lint Build Test Coverage Status codecov Known Vulnerabilities Commitizen friendly License GitHub issues npm

svecchiator

An npm module to brutally update a Node.js project's dependencies

The name

A little explaination of the name svecchiator:

In Italian "svecchiare" means to remove the old parts from something or to renew something. This module will remove the old dependencies, replacing them with the ones with the latest versions.

How does it work

Under the hood, svecchiator reads the package.json file and manually calls the npm install and npm uninstall commands to update the dependencies. It alwo works with pnpm and yarn.

Install

To install svecchiator as a local module:

$ npm install svecchiator

To install svecchiator as a global module:

$ npm install -g svecchiator

Usage (local module)

Upgrade everything

Simple:

import { svecchia } from 'svecchiator';

async function main() {
    await svecchia();
}
main();

With custom configuration:

import { svecchia } from 'svecchiator';

async function main() {
    await svecchia({
        path: '../my-project',
        onlyDevDeps: true,
        cleanCache: true,
        exclude: ['dree', 'eslint'],
        packageManager: 'pnpm'
    });
}
main();

Usage (global module)

Simple

$ svecchia

This will uninstall and install again all the deps and dev deps of the current dir project.

Only dev deps and with another project dir

$ svecchia --dev --source ./my-project

This will uninstall and install again only the dev deps of the project in ./my-project.

Exclude packages

$ svecchia -e eslint -e dree

This will exclude the packages dree and eslint

Other package managers

$ svecchia --package-manager pnpm

This will use pnpm instead of npm to uninstall and install the packages.

More help

$ svecchiator --help

This will show the help of the command.

Code completion

In case you wanted to add the code completion for cli commands, you can use the following command:

$ svecchia completion

It will output the code completion for your shell. You can then add it to your .bashrc or .zshrc file.

For instance, if you want to add it to your .bashrc file, you can do it like this:

$ svecchia completion >> ~/.bashrc

API

Online documentation

The documentation generated with TypeDoc is available in this site. There is also a more specific version for development in this site.

scan

Syntax:

svecchiator.svecchia(options)

Description:

A function that given some options, upgrades the dependencies of the package.json file. It works by running the command to uninstall and install them again. Note: the function is async.

Options parameters:

  • path: Default value: .. The path of the folder containing the package.json file.
  • onlyDevDeps: Default value: false. If true, only the devDependencies will be updated.
  • onlyProdDeps: Default value: false. If true, only the dependencies will be updated.
  • onlyOptionalDeps: Default value: false. If true, only the optional dependencies will be updated.
  • onlyPeerDeps: Default value: false. If true, only the peer dependencies will be updated.
  • cleanCache: Default value: false. If true, the npm cache will be cleaned before updating the dependencies.
  • exclude: Default value: []. The list of dependencies to exclude from the update.
  • only: Default value: []. The list of dependencies to update. If specified and not empty, only the dependencies in this list will be updated.
  • packageManager: Default value: npm. The package manager to use. It can be npm, pnpm or yarn.

Project structure

Made with dree

svecchiator
 ├── .env.example
 ├── .eslintignore
 ├── .eslintrc.cjs
 ├─> .github
 │   └─> workflows
 │       ├── build.yml
 │       ├── dree.yml
 │       ├── lint.yml
 │       └── test.yml
 ├── .gitignore
 ├── .prettierrc.cjs
 ├── .release-it.json
 ├── CHANGELOG.md
 ├── LICENSE
 ├── README.md
 ├── babel.config.cjs
 ├── build.mjs
 ├─> docs
 │   ├── .gitignore
 │   └─> tree
 │       └── dree.config.json
 ├── jest.config.ts
 ├── package.json
 ├── pnpm-lock.yaml
 ├─> source
 │   ├── index.bin.ts
 │   ├── index.ts
 │   ├── shims.d.ts
 │   └── tsconfig.json
 ├─> test
 │   ├── .eslintrc.cjs
 │   ├─> assets
 │   │   ├─> withAllDeps
 │   │   │   └── package.json
 │   │   ├─> withNpmLock
 │   │   │   ├── package-lock.json
 │   │   │   └── package.json
 │   │   ├─> withPnpmLock
 │   │   │   ├── package.json
 │   │   │   └── pnpm-lock.yaml
 │   │   ├─> withProdAndDevDeps
 │   │   │   └── package.json
 │   │   ├─> withYarnLock
 │   │   │   ├── package.json
 │   │   │   └── yarn.lock
 │   │   ├─> withoutDeps
 │   │   │   └── package.json
 │   │   ├─> withoutDevDeps
 │   │   │   └── package.json
 │   │   └─> withoutProdDeps
 │   │       └── package.json
 │   ├─> suites
 │   │   └─> integration
 │   │       ├── auto.test.ts
 │   │       ├── npm.test.ts
 │   │       ├── pnpm.test.ts
 │   │       └── yarn.test.ts
 │   └─> utils
 │       ├── mockExecuteCommand.ts
 │       └── paths.ts
 ├── tsconfig.json
 ├── typedoc.cjs
 └── typedoc.dev.cjs

Development

Make sure that you have all the dependencies installed

Transpile

To transpile the typescript code

$ pnpm transpile

The transpiled code will be in the dist folder.

Bundle

To bundle the library with esbuild:

$ pnpm bundle

The bundled code will be in the bundled folder.