Published
Edited
Feb 9, 2020
2 stars
Insert cell
Insert cell
Insert cell
{
const url = new URL('https://registry.npmjs.com/-/v1/search');
url.search = new URLSearchParams({
text: pkg,
size: 10,
quality: 1,
popularity: .5,
maintenance: 0
});
return fetch(url)
.then(r => r.json())
.then(data => data.objects.map(
({package: {name, version}}) => html`<li>${DOM.text(`${name}@${version}`)}`
))
.then(labels => html`<ul>${labels}`);
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more