diff --git a/.verb.md b/.verb.md index 2f1b5ce..1d4283b 100644 --- a/.verb.md +++ b/.verb.md @@ -54,6 +54,35 @@ $ yarn add {%= name %} ## API +_Generated using [docks](http://npm.im/docks)._ + +### [src/index.js](/src/index.js) + +#### [packageJson](/src/index.js#L26) +Get package metadata from the Unpkg instead of NPM registry. +Optionally you can pass `endpoint` function and return the build +the registry url. See the second test in `test/index.js`. + +**Params** +- `packageName` **{string}** the package name, supports `pkg-name@1.2.2` and `pkg-name@next` +- `endpoint` **{function}** like `(name, tag) => url` + +**Returns** +- `object` package metadata object + +**Examples** +```javascript +import packageJson from '@tunnckocore/package-json'; + +async function main() { + console.log(await packageJson('eslint')); + console.log(await packageJson('package-json@4.0.0')); + console.log(await packageJson('ava@next')); +} + +main().catch(console.error); +``` + **[back to top](#thetop)** diff --git a/README.md b/README.md new file mode 100644 index 0000000..687a48e --- /dev/null +++ b/README.md @@ -0,0 +1,216 @@ +# @tunnckocore/package-json [![npm version][npmv-img]][npmv-url] [![github release][ghrelease-img]][ghrelease-url] [![License][license-img]][license-url] + +> Simple and fast getting of latest package.json metadata for a npm module, using axios and unpkg as a source, because npm registry is basically slow + +Please consider following this project's author, [Charlike Mike Reagent](https://github.com/tunnckoCore), and :star: the project to show your :heart: and support. + +
+ +[![Code style][codestyle-img]][codestyle-url] +[![CircleCI linux build][linuxbuild-img]][linuxbuild-url] +[![CodeCov coverage status][codecoverage-img]][codecoverage-url] +[![DavidDM dependency status][dependencies-img]][dependencies-url] +[![Renovate App Status][renovateapp-img]][renovateapp-url] +[![Make A Pull Request][prs-welcome-img]][prs-welcome-url] +[![Semantically Released][new-release-img]][new-release-url] + +If you have any _how-to_ kind of questions, please read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents. +For bugs reports and feature requests, [please create an issue][open-issue-url] or ping +[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter. + +[![Become a Patron][patreon-img]][patreon-url] +[![Conventional Commits][ccommits-img]][ccommits-url] +[![NPM Downloads Weekly][downloads-weekly-img]][npmv-url] +[![NPM Downloads Monthly][downloads-monthly-img]][npmv-url] +[![NPM Downloads Total][downloads-total-img]][npmv-url] +[![Share Love Tweet][shareb]][shareu] + +Project is [semantically](https://semver.org) & automatically released on [CircleCI](https://circleci.com) with [new-release][] and its [New Release](https://github.com/apps/new-release) GitHub App. + + + +## Table of Contents + +- [Install](#install) +- [API](#api) + * [src/index.js](#srcindexjs) + + [packageJson](#packagejson) +- [See Also](#see-also) +- [Contributing](#contributing) + * [Follow the Guidelines](#follow-the-guidelines) + * [Support the project](#support-the-project) + * [OPEN Open Source](#open-open-source) + * [Wonderful Contributors](#wonderful-contributors) +- [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +This project requires [**Node.js**](https://nodejs.org) **^8.11.0 || >=10.13.0**. Install it using +[**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com). +_We highly recommend to use Yarn when you think to contribute to this project._ + +```bash +$ yarn add @tunnckocore/package-json +``` + +## API + + +_Generated using [docks](http://npm.im/docks)._ + +### [src/index.js](/src/index.js) + +#### [packageJson](/src/index.js#L26) +Get package metadata from the Unpkg instead of NPM registry. +Optionally you can pass `endpoint` function and return the build +the registry url. See the second test in `test/index.js`. + +**Params** +- `packageName` **{string}** the package name, supports `pkg-name@1.2.2` and `pkg-name@next` +- `endpoint` **{function}** like `(name, tag) => url` + +**Returns** +- `object` package metadata object + +**Examples** +```javascript +import packageJson from '@tunnckocore/package-json'; + +async function main() { + console.log(await packageJson('eslint')); + console.log(await packageJson('package-json@4.0.0')); + console.log(await packageJson('ava@next')); +} + +main().catch(console.error); +``` + + + +**[back to top](#thetop)** + +## See Also + +Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your +existance! +- [@tunnckocore/config](https://www.npmjs.com/package/@tunnckocore/config): All the configs for all the tools, in one place | [homepage](https://github.com/tunnckoCoreLabs/config "All the configs for all the tools, in one place") +- [@tunnckocore/create-project](https://www.npmjs.com/package/@tunnckocore/create-project): Create and scaffold a new project, its GitHub repository and… [more](https://github.com/tunnckoCoreLabs/create-project) | [homepage](https://github.com/tunnckoCoreLabs/create-project "Create and scaffold a new project, its GitHub repository and contents") +- [@tunnckocore/execa](https://www.npmjs.com/package/@tunnckocore/execa): Thin layer on top of [execa][] that allows executing multiple… [more](https://github.com/tunnckoCoreLabs/execa) | [homepage](https://github.com/tunnckoCoreLabs/execa "Thin layer on top of [execa][] that allows executing multiple commands in parallel or in sequence") +- [@tunnckocore/scripts](https://www.npmjs.com/package/@tunnckocore/scripts): Universal and minimalist scripts & tasks runner. | [homepage](https://github.com/tunnckoCoreLabs/scripts "Universal and minimalist scripts & tasks runner.") +- [@tunnckocore/update](https://www.npmjs.com/package/@tunnckocore/update): Update a repository with latest templates from `charlike`. | [homepage](https://github.com/tunnckoCoreLabs/update "Update a repository with latest templates from `charlike`.") +- [asia](https://www.npmjs.com/package/asia): Blazingly fast, magical and minimalist testing framework, for Today and… [more](https://github.com/olstenlarck/asia#readme) | [homepage](https://github.com/olstenlarck/asia#readme "Blazingly fast, magical and minimalist testing framework, for Today and Tomorrow") +- [charlike](https://www.npmjs.com/package/charlike): Small & fast project scaffolder with sane defaults. Supports hundreds… [more](https://github.com/tunnckoCoreLabs/charlike) | [homepage](https://github.com/tunnckoCoreLabs/charlike "Small & fast project scaffolder with sane defaults. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options") +- [docks](https://www.npmjs.com/package/docks): Extensible system for parsing and generating documentation. It just freaking… [more](https://github.com/tunnckoCore/docks) | [homepage](https://github.com/tunnckoCore/docks "Extensible system for parsing and generating documentation. It just freaking works!") +- [gitcommit](https://www.npmjs.com/package/gitcommit): Lightweight and joyful `git commit` replacement. Conventional Commits compliant. | [homepage](https://github.com/tunnckoCore/gitcommit "Lightweight and joyful `git commit` replacement. Conventional Commits compliant.") + +**[back to top](#thetop)** + +## Contributing + +### Follow the Guidelines + +Please read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents for advices. +For bugs reports and feature requests, [please create an issue][open-issue-url] or ping +[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter. + +### Support the project + +[Become a Partner or Sponsor?][patreon-url] :dollar: Check the **Partner**, **Sponsor** or **Omega-level** tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in [npmjs.com][npmv-url] and [yarnpkg.com](https://yarnpkg.com/en/package/@tunnckocore/package-json) sites too! :rocket: + +Not financial support? Okey! [Pull requests](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request), stars and all kind of [contributions](https://opensource.guide/how-to-contribute/#what-it-means-to-contribute) are always +welcome. :sparkles: + +### OPEN Open Source + +This project is following [OPEN Open Source](http://openopensource.org) model + +> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders. + +There are a few basic ground-rules for its contributors + +1. Any **significant modifications** must be subject to a pull request to get feedback from other contributors. +2. [Pull requests](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request) to get feedback are _encouraged_ for any other trivial contributions, but are not required. +3. Contributors should attempt to adhere to the prevailing code-style and development workflow. + +### Wonderful Contributors + +Thanks to the hard work of these wonderful people this project is alive! It follows the +[all-contributors](https://github.com/kentcdodds/all-contributors) specification. +Don't hesitate to add yourself to that list if you have made any contribution! ;) [See how, +here](https://github.com/jfmengels/all-contributors-cli#usage). + + + +| [