0.0.1 • Published 6 years ago
npm-lib-package-example v0.0.1
NPM lib package example
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
- Overally this package doesn't do anything useful, it just wraps Github API endpoint with Axios
- Code is splitted into multiple files just to should how it might be done
babel-plugin-rewire
is used in tests to show how non-exported functions might be testedjest-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
Author
Jan Grzegorowski