0.0.1 • Published 6 years ago

npm-lib-package-example v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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