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

noxys-deps

v2.1.2

Published

Noxys Dependencies checker library

Downloads

17

Readme

Noxys Dependencies

Build Status Build Status npm Dependency Status

Description

Noxys Depdendencies is a library that provide a way to parse dependency files and allow to check updates for dependencies on official repositories OR your repositories.

Features

  • Parse dependency file
  • Check updates on official or private repositories
  • Get libraries list that need to be updated

Supported Platforms

  • NodeJS :
    • NPM (package.json)
  • Java :
    • Maven (pom.xml)
    • Gradle (build.gradle)
  • Python :
    • Requirements (requirements.txt)
  • Docker :
    • Docker (Dockerfile)
  • Ruby :
    • rubygems (Gemfile)

How to use

Install

npm install --save noxys-deps

or

yarn add noxys-deps

Example Usage

const NoxysDependencies = require('noxys-deps');
const noxysDepInstance = new NoxysDependencies();
const requirementsTxtString = fs.readFileSync(path.resolve('dev/files/requirements.txt')).toString();

noxysDepInstance.parseManifestString('requirements.txt', requirementsTxtString).then((dependencies) => {
    console.log(noxysDepInstance.dependencies);
    console.log(dependencies);
    noxysDepInstance.checkUpdates().then((results) => {
        console.log(results);
    }).catch(console.error);
}).catch(console.error);

API

NoxysDependencies

Class that have all methods for parsing, check dependencies, ...

getUpdatedManifestString

This static function is here to generate updated manifest from one put in parameter.

Parameters: | Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None | | manifestString | Manifest in string | String | True | None | | dependenciesToUpdate | Dependencies list to update (given by NoxysDependencies and from checkUpdates) in the manifest (Update from "version" to "latest") | Array | True | None |

Return: Promise => Manifest updated in string

getUpdatedManifestFile

This static function is here to generate updated manifest from one put in parameter.

Parameters: | Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None | | manifestFilePath | Manifest file path | String | True | None | | dependenciesToUpdate | Dependencies list to update (given by NoxysDependencies and from checkUpdates) in the manifest (Update from "version" to "latest") | Array | True | None |

Return: Promise => Manifest updated in string

isManifestSupported

This static function is here to check if manifest is supported for parsing, ...

Parameters:

| Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None |

Return: Boolean

getPlatformName

This static function is here to get the platform name from manifest file name.

Parameters:

| Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None |

Return: String

getPlatformConfigurationKeyRelation

This static function is here to get the relation between configuration key and platform.

Return: Array

getDefaultConfiguration

This static method is here to get default configuration.

Return: Object

getUpdateTypes

This static method is here to get update types. Example of keys: NONE, UNKNOWN,...

Return: Object

Constructor

Parameters :

  • Configuration :
const configuration = {
    npm: {
        registryUrl: 'http://localhost:8081/repository/npm',
        auth: {
            username: 'admin',
            password: 'admin123',
        },
    },
    maven: {
        registryUrl: 'http://localhost:8081/repository/maven-public',
        auth: {
            username: 'admin',
            password: 'admin123',
        },
    },
    docker: {
        registryUrl: 'http://localhost:5001',
        auth: {
            username: 'admin',
            password: 'admin123',
        },
        concurrency: 15,
    },
    rubygems: {
        registryUrl: 'http://localhost:8081/repository/rubygems-proxy/',
        auth: {
            username: undefined,
            password: undefined,
        },
        concurrency: 5,
    },
    pypi: {
        registryUrl: 'http://localhost:8081/repository/pypi/',
        concurrency: 5,
    },
};

(You can give only the one you don't want to use a private repository or to change a configuration like concurrency).

parseManifestString

This function will parse the manifest and will return dependencies found in.

Parameters :

| Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None | | manifestString | Manifest String | String | True | None |

Return: Promise with dependencies

#### parseManifestFile This function will parse the manifest and will return dependencies found in.

Parameters :

| Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | fileName | File Name (example: 'build.gradle', 'package.json') | String | True | None | | manifestFilePath | Manifest File Path | String | True | None |

Return: Promise with dependencies

checkUpdates

This function will check if there is updates for parsed dependencies on registry (specified in configuration).

Return: Promise with dependencies (with latest version and update type)

getUpdatedManifest

This function is here to generate updated manifest.

Parameters: | Key | Description | Type | Required | Default | |:--------:|:---------------------------:|:------------:|:--------:|:--------:| | dependenciesToUpdate | Dependencies list to update (given by NoxysDependencies and from checkUpdates) in the manifest (Update from "version" to "latest") | Array | True | None |

Return: Promise => Manifest updated in string

Model

Dependency model :

const dependency = {
  "name": "org.glassfish.jersey.core:jersey-server",
  "type": "runtime", // "test", "development", "peer", "optional", "provided (only during compilation)", "unknown"
  "version": "2.26-b02",
  "latest": "2.27", // Will be added with checkUpdates
  "updateType": "major" // Will be added with checkUpdates
}

Thanks

  • My wife BH to support me doing this

Author

  • Oxyno-zeta (Havrileck Alexandre)

License

MIT (See in License.md)