\href{https://github.com/npm/npm-pick-manifest}{\texttt{ {\ttfamily npm-\/pick-\/manifest}}} is a standalone implementation of \href{https://npmjs.com}{\texttt{ npm}}\textquotesingle{}s semver range resolution algorithm.\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19932}{}\doxysection{Install}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19932}
{\ttfamily \$ npm install -\/-\/save npm-\/pick-\/manifest}\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19933}{}\doxysection{Table of Contents}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19933}

\begin{DoxyItemize}
\item \href{\#example}{\texttt{ Example}}
\item \href{\#features}{\texttt{ Features}}
\item \href{\#contributing}{\texttt{ Contributing}}
\item \href{\#api}{\texttt{ API}}
\begin{DoxyItemize}
\item \href{\#pick-manifest}{\texttt{ {\ttfamily pick\+Manifest()}}}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19934}{}\doxysubsection{Example}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19934}

\begin{DoxyCode}{0}
\DoxyCodeLine{const pickManifest = require('npm-\/pick-\/manifest')}
\DoxyCodeLine{}
\DoxyCodeLine{fetch('https://registry.npmjs.org/npm-\/pick-\/manifest').then(res => \{}
\DoxyCodeLine{  return res.json()}
\DoxyCodeLine{\}).then(packument => \{}
\DoxyCodeLine{  return pickManifest(packument, '\string^1.0.0')}
\DoxyCodeLine{\}) // get same manifest as npm would get if you `npm i npm-\/pick-\/manifest@\string^1.0.0` }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19935}{}\doxysubsection{Features}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19935}

\begin{DoxyItemize}
\item Uses npm\textquotesingle{}s exact semver resolution algorithm
\item Supports ranges, tags, and versions
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19936}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19936}
The npm-\/pick-\/manifest team enthusiastically welcomes contributions and project participation! There\textquotesingle{}s a bunch of things you can do if you want to contribute! The ContributorGuide"{} has all the information you need for everything from reporting bugs to contributing entire new features. Please don\textquotesingle{}t hesitate to jump in if you\textquotesingle{}d like to, or even ask us questions if something isn\textquotesingle{}t clear.\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19937}{}\doxysubsection{API}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19937}
\hypertarget{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19938}{}\doxysubsubsection{$<$a name=\char`\"{}pick-\/manifest\char`\"{}$>$$<$/a$>$ $<$tt$>$$>$ pick\+Manifest(packument, selector, \mbox{[}opts\mbox{]}) -\/$>$ manifest$<$/tt$>$}\label{md_sfcode_node_modules_pacote_node_modules_npm_pick_manifest_README_autotoc_md19938}
Returns the manifest that matches {\ttfamily selector}, or throws an error.

Packuments are anything returned by metadata URLs from the npm registry. That is, they\textquotesingle{}re objects with the following shape (only fields used by {\ttfamily npm-\/pick-\/manifest} included)\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{  name: 'some-\/package',}
\DoxyCodeLine{  'dist-\/tags': \{}
\DoxyCodeLine{    foo: '1.0.1'}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  versions: \{}
\DoxyCodeLine{    '1.0.0': \{ version: '1.0.0' \},}
\DoxyCodeLine{    '1.0.1': \{ version: '1.0.1' \},}
\DoxyCodeLine{    '1.0.2': \{ version: '1.0.2' \},}
\DoxyCodeLine{    '2.0.0': \{ version: '2.0.0' \}}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\} }

\end{DoxyCode}


The algorithm will follow npm\textquotesingle{}s algorithm for semver resolution, and only {\ttfamily tag}, {\ttfamily range}, and {\ttfamily version} selectors are supported.

The function will throw {\ttfamily ETARGET} if there was no matching manifest, and {\ttfamily ENOVERSIONS} if the packument object has no valid versions in {\ttfamily versions}.

If {\ttfamily opts.\+default\+Tag} is provided, it will be used instead of {\ttfamily latest}. That is, if that tag matches the selector, it will be used, even if a higher available version matches the range.

If {\ttfamily opts.\+enjoy\+By} is provided, it should be something that can be passed to {\ttfamily new Date(x)}, such as a {\ttfamily Date} object or a timestamp string. It will be used to filter the selected versions such that only versions less than or equal to {\ttfamily enjoy\+By} are considered.

If {\ttfamily opts.\+include\+Deprecated} passed in as true, deprecated versions will be selected. By default, deprecated versions other than {\ttfamily default\+Tag} are ignored. 