All Projects → doowb → Npm Api

doowb / Npm Api

Licence: mit
Node.js library for getting info from NPM’s API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Npm Api

Wasm Pack
This tool seeks to be a one-stop shop for building and working with rust- generated WebAssembly that you would like to interop with JavaScript, in the browser or with Node.js. wasm-pack helps you build rust-generated WebAssembly packages that you could publish to the npm registry, or otherwise use alongside any javascript packages in workflows that you already use, such as webpack.
Stars: ✭ 3,848 (+5643.28%)
Mutual labels:  registry, package, npm
Enseada
A Cloud native multi-package registry
Stars: ✭ 80 (+19.4%)
Mutual labels:  registry, package, npm
Lass
👧 Lass scaffolds a modern package boilerplate for Node.js
Stars: ✭ 615 (+817.91%)
Mutual labels:  package, npm
Oji
(◕‿◕) Text Emoticons Maker
Stars: ✭ 668 (+897.01%)
Mutual labels:  package, npm
Typac
install npm packages along with corresponding typings
Stars: ✭ 29 (-56.72%)
Mutual labels:  package, npm
Npm Consider
Check package dependencies before installing it
Stars: ✭ 386 (+476.12%)
Mutual labels:  package, npm
Nupdate
A comfortable update solution for .NET-applications.
Stars: ✭ 394 (+488.06%)
Mutual labels:  registry, package
Snm
🤏 Smol Node Manager written in Rust
Stars: ✭ 24 (-64.18%)
Mutual labels:  package, npm
Gub
CLI tool for create an npm package from any repos. 🐳
Stars: ✭ 31 (-53.73%)
Mutual labels:  package, npm
Npmf
Fetch quick info of a npm pacakge using terminal
Stars: ✭ 64 (-4.48%)
Mutual labels:  package, npm
Verdaccio Ldap
LDAP auth plugin for verdaccio
Stars: ✭ 39 (-41.79%)
Mutual labels:  registry, npm
Codebox Npm
Serverless private npm registry using https://serverless.com/
Stars: ✭ 340 (+407.46%)
Mutual labels:  registry, npm
Cnpmjs.org
Private npm registry and web for Enterprise
Stars: ✭ 3,536 (+5177.61%)
Mutual labels:  registry, npm
Vanilla Framework
From community websites to web applications, this CSS framework will help you achieve a consistent look and feel.
Stars: ✭ 476 (+610.45%)
Mutual labels:  package, npm
Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (+391.04%)
Mutual labels:  package, npm
Lerna
Splitting up large codebases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories becomes complicated very quickly.
Stars: ✭ 31,079 (+46286.57%)
Mutual labels:  package, npm
Npm Git Install
Clones and (re)installs packages from remote git repos. See npm/npm#3055
Stars: ✭ 49 (-26.87%)
Mutual labels:  package, npm
Open Registry
Community Owned JavaScript Registry
Stars: ✭ 259 (+286.57%)
Mutual labels:  registry, npm
Nest.land
🦕 The nest.land website
Stars: ✭ 294 (+338.81%)
Mutual labels:  registry, package
Sao Nm
Scaffold out a node module.
Stars: ✭ 30 (-55.22%)
Mutual labels:  package, npm

npm-api NPM version NPM monthly downloads NPM total downloads Linux Build Status

Node.js library for getting info from NPM’s API

Please consider following this project's author, Brian Woodward, and consider starring the project to show your ❤️ and support.

Install

Install with npm:

$ npm install --save npm-api

Usage

var NpmApi = require('npm-api');

API

NpmApi

NpmApi constructor. Create an instance to work with maintainer and repository information.

Example

let npm = new NpmApi();

.view

Create a new instance of View or get an existing instance to work with npm couchdb views.

Params

  • name {String}: Name of the couchdb view to work with.
  • returns {Object} View: instance

Example

var view = npm.view('byUser');

.list

Create a new instance of List or get an existing instance to work with npm couchdb list.

Params

  • name {String}: Name of the couchdb list to work with.
  • view {String|Object}: Name or instance of a view to work with.
  • returns {Object} List: instance

Example

var list = npm.list('sortCount', 'byUser');

.repo

Create an instance of a repo to work with.

Params

  • name {String}: Name of the repo as it's published to npm.
  • returns {Object}: Instance of a Repo model to work with.

Example

var repo =  npm.repo('micromatch');

.maintainer

Create an instance of a maintainer to work with.

Params

  • name {String}: Npm username of the maintainer.
  • returns {Object}: Instance of a Maintainer model to work with.

Example

var maintainer =  npm.maintainer('doowb');

Models

BaseModel

Base model to include common plugins.

Params

  • store {Object}: Cache store instance to use.

Maintainer

Maintainer constructor. Create an instance of an npm maintainer by maintainer name.

Params

  • name {String}: Name of the npm maintainer to get information about.

Example

const maintainer = new Maintainer('doowb');

.repos

Get the repositories owned by this maintainer.

  • returns {Promise}: Returns array of repository names when promise resolves.

Example

maintainer.repos()
  .then(function(repos) {
    console.log(repos);
  }, function(err) {
    console.error(err);
  });

Repo

Repo constructor. Create an instance of an npm repo by repo name.

Params

  • name {String}: Name of the npm repo to get information about.

Example

const repo = new Repo('micromatch');

.package

Get the repo's published package.json.

  • returns {Promise}: Returns the package.json object when promise resolves.

Example

repo.package()
  .then(function(pkg) {
    console.log(pkg);
  }, function(err) {
    console.error(err);
  });

.version

Get the repo's published package.json value for the specified version.

Params

  • version {String}: Specific version to retrieve.
  • returns {Promise}: Returns the package.json object for the specified version when promise resolves.

Example

repo.version('0.2.0')
  .then(function(pkg) {
    console.log(pkg);
  }, function(err) {
    console.error(err);
  });

.dependencies

Get the repo's dependencies for the specified version.

Params

  • version {String}: Specific version to retrieve. Defaults to latest.
  • returns {Promise}: Returns the dependencies object for the specified version when promise resolves.

Example

repo.dependencies()
  .then(function(dependencies) {
    console.log(dependencies);
  }, function(err) {
    console.error(err);
  });

.devDependencies

Get the repo's devDependencies for the specified version.

Params

  • version {String}: Specific version to retrieve. Defaults to latest.
  • returns {Promise}: Returns the devDependencies object for the specified version when promise resolves.

Example

repo.devDependencies()
  .then(function(devDependencies) {
    console.log(devDependencies);
  }, function(err) {
    console.error(err);
  });

.prop

Get the specified property from the repo's package.json for the specified version.

Params

  • prop {String}: Name of the property to get.
  • version {String}: Specific version to retrieve. Defaults to latest.
  • returns {Promise}: Returns the property for the specified version when promise resolves.

Example

repo.prop('author')
  .then(function(author) {
    console.log(author);
  }, function(err) {
    console.error(err);
  });

Registry queries

View

View constructor. Create an instance of a view associated with a couchdb view in the npm registry.

Params

  • name {String}: Name of couchdb view to use.
  • returns {Object}: instance of View

Example

const view = new View('dependedUpon');

.query

Query the couchdb view with the provided parameters.

Params

  • params {Object}: URL query parameters to pass along to the couchdb view.
  • returns {Promise}: Results of the query when promise is resolved.

Example

let results = await view.query({
  group_level: 2,
  startkey: JSON.stringify(['micromatch']),
  endkey: JSON.stringify(['micromatch', {}])
});

.stream

Query the couchdb view with the provided parameters and return a stream of results.

Params

  • params {Object}: URL query parameters to pass along to the couchdb view.
  • returns {Stream}: Streaming results of the query.

Example

view.stream({
  group_level: 2,
  startkey: JSON.stringify(['micromatch']),
  endkey: JSON.stringify(['micromatch', {}])
})
.on('data', (data) => {
  console.log(data);
});

.url

Build a formatted url with the provided parameters.

Params

  • query {Object}: URL query parameters.
  • returns {String}: formatted url string

List

List constructor. Create an instance of a list associated with a couchdb list in the npm registry.

Params

  • name {String}: Name of couchdb list to use.
  • view {Object}: Instance of a View to use with the list.
  • returns {Object}: instance of List

Example

let list = new List('dependedUpon', view);

.query

Query the couchdb list with the provided parameters.

Params

  • params {Object}: URL query parameters to pass along to the couchdb list.
  • returns {Promise}: Results of the query when promise is resolved.

Example

let results = await list.query({ key: JSON.stringify(['micromatch']) })

.url

Build a formatted url with the provided parameters.

Params

  • query {Object}: URL query parameters.
  • returns {String}: formatted url string

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

You might also be interested in these projects:

  • base: Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | homepage
  • download-stats: Get and calculate npm download stats for npm modules. | homepage

Contributors

Commits Contributor
115 doowb
1 0xflotus
1 Hypnosphi
1 NachmanBerkowitz

Author

Brian Woodward

License

Copyright © 2021, Brian Woodward. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on January 20, 2021.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].