JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 60
  • Score
    100M100P100Q34520F
  • License MIT

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

Package Exports

  • svecchiator

Readme

Build 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.

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']
    });
}
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.

This will exclude the packages dree and eslint

$ svecchia -e eslint -e dree

More help

This will show the help of the command.

$ svecchiator --help

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.
  • 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.

Project structure

Made with dree

svecchiator
 ├─> .github
 │   └─> workflows
 │       ├── build.yml
 │       ├── dree.yml
 │       └── lint.yml
 ├── .gitignore
 ├── CHANGELOG.md
 ├── LICENSE
 ├── README.md
 ├── build.mjs
 ├─> docs
 │   ├── .gitignore
 │   └─> tree
 │       └── dree.config.json
 ├── package-lock.json
 ├── package.json
 ├─> source
 │   ├── .eslintignore
 │   ├── .eslintrc.cjs
 │   ├── .prettierrc.cjs
 │   ├── index.bin.ts
 │   ├── index.ts
 │   └── tsconfig.json
 ├── typedoc.cjs
 └── typedoc.dev.cjs

Development

Make sure that you have all the dependencies installed

Transpile

To transpile the typescript code

$ npm run transpile

The transpiled code will be in the dist folder.

Bundle

To bundle the library with esbuild:

$ npm run bundle

The bundled code will be in the bundled folder.