Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-06-03 22:59:07 +0300
committerGar <gar+gh@danger.computer>2021-06-10 20:10:35 +0300
commita4a0e68a9e34a4c99e10e4fb8c5f89d323a4192f (patch)
treece5c982c758a762b9980fc6a087031bd8953ce75 /node_modules/libnpmsearch
parentf130a81d62bf4f540ab252a09ff5a618827f9265 (diff)
chore: check less stuff into node_modules
We bundle our deps, but we don't need to bundle docs, changelogs, editorconfigs, test coverage reports, .github workflow definitions, lint configurations, and all the rest, which we never use. This cuts about 10% off of our publish artifact file size. ``` $ ls -laF npm-7.16.0-*.tgz -rw-r--r-- 1 isaacs staff 7174497 Jun 3 13:01 npm-7.16.0-release-next.tgz -rw-r--r-- 1 isaacs staff 6782377 Jun 3 13:00 npm-7.16.0-trim-node-modules.tgz $ ls -laF npm-7.16.0-*.tar -rw-r--r-- 1 isaacs staff 19020288 Jun 3 13:01 npm-7.16.0-release-next.tar -rw-r--r-- 1 isaacs staff 17474048 Jun 3 13:00 npm-7.16.0-trim-node-modules.tar ``` PR-URL: https://github.com/npm/cli/pull/3362 Credit: @isaacs Close: #3362 Reviewed-by: @nlf
Diffstat (limited to 'node_modules/libnpmsearch')
-rw-r--r--node_modules/libnpmsearch/README.md173
1 files changed, 0 insertions, 173 deletions
diff --git a/node_modules/libnpmsearch/README.md b/node_modules/libnpmsearch/README.md
deleted file mode 100644
index 31f44fe24..000000000
--- a/node_modules/libnpmsearch/README.md
+++ /dev/null
@@ -1,173 +0,0 @@
-# libnpmsearch
-
-[![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch)
-[![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch)
-[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmsearch/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmsearch?branch=latest)
-
-[`libnpmsearch`](https://github.com/npm/libnpmsearch) is a Node.js library for
-programmatically accessing the npm search endpoint. It does **not** support
-legacy search through `/-/all`.
-
-## Table of Contents
-
-* [Example](#example)
-* [Install](#install)
-* [Contributing](#contributing)
-* [API](#api)
- * [search opts](#opts)
- * [`search()`](#search)
- * [`search.stream()`](#search-stream)
-
-## Example
-
-```js
-const search = require('libnpmsearch')
-
-console.log(await search('libnpm'))
-=>
-[
- {
- name: 'libnpm',
- description: 'programmatic npm API',
- ...etc
- },
- {
- name: 'libnpmsearch',
- description: 'Programmatic API for searching in npm and compatible registries',
- ...etc
- },
- ...more
-]
-```
-
-## Install
-
-`$ npm install libnpmsearch`
-
-### API
-
-#### <a name="opts"></a> `opts` for `libnpmsearch` commands
-
-The following opts are used directly by `libnpmsearch` itself:
-
-* `opts.limit` - Number of results to limit the query to. Default: 20
-* `opts.from` - Offset number for results. Used with `opts.limit` for pagination. Default: 0
-* `opts.detailed` - If true, returns an object with `package`, `score`, and `searchScore` fields, with `package` being what would usually be returned, and the other two containing details about how that package scored. Useful for UIs. Default: false
-* `opts.sortBy` - Used as a shorthand to set `opts.quality`, `opts.maintenance`, and `opts.popularity` with values that prioritize each one. Should be one of `'optimal'`, `'quality'`, `'maintenance'`, or `'popularity'`. Default: `'optimal'`
-* `opts.maintenance` - Decimal number between `0` and `1` that defines the weight of `maintenance` metrics when scoring and sorting packages. Default: `0.65` (same as `opts.sortBy: 'optimal'`)
-* `opts.popularity` - Decimal number between `0` and `1` that defines the weight of `popularity` metrics when scoring and sorting packages. Default: `0.98` (same as `opts.sortBy: 'optimal'`)
-* `opts.quality` - Decimal number between `0` and `1` that defines the weight of `quality` metrics when scoring and sorting packages. Default: `0.5` (same as `opts.sortBy: 'optimal'`)
-
-`libnpmsearch` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch).
-Most options are passed through directly to that library, so please refer to
-[its own `opts`
-documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options)
-for options that can be passed in.
-
-A couple of options of note for those in a hurry:
-
-* `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs.
-
-#### <a name="search"></a> `> search(query, [opts]) -> Promise`
-
-`query` must be either a String or an Array of search terms.
-
-If `opts.limit` is provided, it will be sent to the API to constrain the number
-of returned results. You may receive more, or fewer results, at the endpoint's
-discretion.
-
-The returned Promise resolved to an Array of search results with the following
-format:
-
-```js
-{
- name: String,
- version: SemverString,
- description: String || null,
- maintainers: [
- {
- username: String,
- email: String
- },
- ...etc
- ] || null,
- keywords: [String] || null,
- date: Date || null
-}
-```
-
-If `opts.limit` is provided, it will be sent to the API to constrain the number
-of returned results. You may receive more, or fewer results, at the endpoint's
-discretion.
-
-For streamed results, see [`search.stream`](#search-stream).
-
-##### Example
-
-```javascript
-await search('libnpm')
-=>
-[
- {
- name: 'libnpm',
- description: 'programmatic npm API',
- ...etc
- },
- {
- name: 'libnpmsearch',
- description: 'Programmatic API for searching in npm and compatible registries',
- ...etc
- },
- ...more
-]
-```
-
-#### <a name="search-stream"></a> `> search.stream(query, [opts]) -> Stream`
-
-`query` must be either a String or an Array of search terms.
-
-If `opts.limit` is provided, it will be sent to the API to constrain the number
-of returned results. You may receive more, or fewer results, at the endpoint's
-discretion.
-
-The returned Stream emits one entry per search result, with each entry having
-the following format:
-
-```js
-{
- name: String,
- version: SemverString,
- description: String || null,
- maintainers: [
- {
- username: String,
- email: String
- },
- ...etc
- ] || null,
- keywords: [String] || null,
- date: Date || null
-}
-```
-
-For getting results in one chunk, see [`search`](#search-stream).
-
-##### Example
-
-```javascript
-search.stream('libnpm').on('data', console.log)
-=>
-// entry 1
-{
- name: 'libnpm',
- description: 'programmatic npm API',
- ...etc
-}
-// entry 2
-{
- name: 'libnpmsearch',
- description: 'Programmatic API for searching in npm and compatible registries',
- ...etc
-}
-// etc
-```