npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

figshare

v1.0.3

Published

Figshare cli and node.js library

Downloads

6

Readme

Figshare

A library for interacting with Figshare API.

CLI

npm install -g figshare

figshare download [dir] [--raw]

Download an article's assets and metadata to a given directory. Will create a datapackage.json by default, and uses figshare's article spec if --raw supplied.

$ figshare download 1559145 grassland_data
$ cd grassland_data/
$ ls
Ecology-Lab2-Group3-DataSet2.xlsx
datapackage.json

Also can work if you give the HTML URL link:

$ figshare download http://figshare.com/articles/Group_4_Dataset_2_Grassland_data_of_the_plant_Purple_Aster_Aster_prenathoides_/1559145

figshare search

$ figshare search hello
1444470 UGH HATE FIGSHARE
1444440 Hello
1351281 <i>Shigella</i> serotypes identified in the study.
1351279 Distribution of organism identified in children with watery or bloody diarrhea by age group.
1351282 <i>Salmonella</i> serotypes identified in the study (N = 355).
1351284 Enteric Bacterial Pathogens in Children with Diarrhea in Niger: Diversity and Antimicrobial Resistance
1115016 An Adaptive Hello Messaging and Multipath Route  Maintenance in On-Demand MANET Routing Protocol
1100253 An Energy Efficient Acknowledgement Based Ids For Manet
1098621 A Beaconless Routing Approach for Energy Conservation in  Wireless Sensor Network

JavaScript

var figshare = require('figshare')

figshare(opts)

Options:

uri: can be changed if you have your own deployment. Default 'http://api.figshare.com'

version: defaults to 1, there is only one version of figshare search

figshare.get(id, cb)

Hits the figshare api and gets the article with the given id. Will also work with the html url.

figshare.get(id, function (err, article) {
  if (err) throw err
  console.log(article)
})

figshare.download(article, dir, args, cb)

Downloads the article.

article: the article as returned by figshare.get

dir: the directory to put the data into. Will create it if it doesn't exist.

figshare.download(article, dir, args, function (err) {
  if (err) throw err
  console.error('Download complete.')
})

figshare.search(query)

var stream = figshare.stream({fulltext: 'your fulltext query text here'})
stream.on('data', function (data) {
  console.log(data.items) // each 'data' is a page from the figshare search api
})