New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

npm-lib-package-example

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-lib-package-example

Example of NPM library package build with Babel, Rollup, Jest, Flow, ESLint and Travis CI

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM lib package example

Build Status dependencies Status devDependencies Status License: MIT

Read detailed description/tutorial on https://www.grzegorowski.com/publishing-npm-package-with-rollup-babel-and/ or check boilerplate repository https://github.com/jmarceli/npm-lib-package-boilerplate to get more info.

Overview

  1. Overally this package doesn't do anything useful, it just wraps Github API endpoint with Axios
  2. Code is splitted into multiple files just to should how it might be done
  3. babel-plugin-rewire is used in tests to show how non-exported functions might be tested
  4. jest-mock-axios packages and mocks/ directory shows how to test Axios based calls

Installation

yarn add npm-lib-package-example

Usage

Despite the fact that this package has no point to exists, you may still use it in your script. Start your file with // @flow if you are using Flow type checking.

// @flow

const getRateLimitResponse = require('npm-lib-package-example').getRateLimitResponse;
// or with Babel: import { getRateLimitResponse } from 'npm-lib-package-example';

const start = async () => {
  const result = await getRateLimitResponse();
  console.log(result);
};

start();

License

MIT

Author

Jan Grzegorowski

Keywords

FAQs

Package last updated on 04 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc