6.0.0 • Published 1 year ago

fast-outdated v6.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
1 year ago

Fast-outdated

version Maintenance MIT size Known Vulnerabilities

Fast and Programmatically npm outdated --json implementation that use pacote to achieve similar result.

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i fast-outdated
# or
$ yarn add fast-outdated

Usage example

const { outdated, clearCache } = require("fast-outdated");

async function main() {
    clearCache();
    const data = await outdated(void 0, { devDependencies: true });
    console.log(JSON.stringify(data, null, 4));
}
main().catch(console.error);

API

declare namespace Outdated {
    interface Packages {
        [packageName: string]: {
            wanted: string;
            current: string;
            latest: string;
            location: string;
        }
    }

    interface Options {
        devDependencies?: boolean;
        token?: string;
    }

    export function outdated(cwd?: string, options?: Options): Promise<Packages>;
    export function clearCache(): any;
}

export as namespace Outdated;
export = Outdated;

outdated(cwd?: string, options?: Outdated.Options): Promise< Outdated.Packages >

Will give you equivalent result that the command npm outdated --json. The default cwd value will be equal to process.cwd().

Options:

namedefault valuedescription
devDependenciesfalseInclude devDependencies
tokenundefinednpm token for private packages

clearCache()

Call pacote.clearMemoized.

Roadmap

  • Improve test suite

License

MIT

6.0.0

1 year ago

5.0.0

3 years ago

4.0.0

3 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago