npm-lib-package-example

0.0.1 • Public • Published

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

Package Sidebar

Install

npm i npm-lib-package-example

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

8.35 kB

Total Files

11

Last publish

Collaborators

  • jmarceli