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

node-europmc

v0.0.3

Published

A package to query the EuropePMC API.

Downloads

12

Readme

#node-europmc

A nodejs wrapper for the europe PMC RESTful API. https://europepmc.org/RestfulWebService

Code based in node-ncib (https://github.com/CAYdenberg/node-ncbi) and getpapers(https://github.com/ContentMine/getpapers)

Getting started

npm install --save node-europepmc `

And on your node code:

var pmc = require('node-europepmc');

Basic use

Performing a search

The basic function queries the Europe PMC API using 4 parameters:

query : The search string of choice n_papers : the number of papers which info will be returned sorting_type : How the papers will be sorted. Default is "relevance", but can be changed to "date" or "citation". metadata : Amount of metadata required. Defaults to "lite" (essential metadata). The other option is "full", which includes abstract, full text links, and MeSH terms.

let query = "dendritic cell"


pmc.search_papers(query, n_papers = 2, sorting_type = "citation").then((results) => {

    console.log(results)


})

This will log

{ count: 230059,
  papers: 
   [ { id: '9521319',
       source: 'MED',
       pmid: '9521319',
       doi: '10.1038/32588',
       title: 'Dendritic cells and the control of immunity.',
       authorString: 'Banchereau J, Steinman RM.',
       journalTitle: 'Nature',
       issue: '6673',
       journalVolume: '392',
       pubYear: '1998',
       journalIssn: '0028-0836; 1476-4687; ',
       pageInfo: '245-252',
       pubType: 'research support, u.s. gov\'t, p.h.s.; review; journal article',
       isOpenAccess: 'N',
       inEPMC: 'N',
       inPMC: 'N',
       hasPDF: 'N',
       hasBook: 'N',
       citedByCount: 7201,
       hasReferences: 'Y',
       hasTextMinedTerms: 'Y',
       hasDbCrossReferences: 'N',
       hasLabsLinks: 'Y',
       hasTMAccessionNumbers: 'N',
       firstIndexDate: '2008-01-29',
       firstPublicationDate: '1998-03-01' },
     { id: '12490959',
       source: 'MED',
       pmid: '12490959',
       pmcid: 'PMC2803035',
       doi: '10.1038/nature01322',
       title: 'Inflammation and cancer.',
       authorString: 'Coussens LM, Werb Z.',
       journalTitle: 'Nature',
       issue: '6917',
       journalVolume: '420',
       pubYear: '2002',
       journalIssn: '0028-0836; 1476-4687; ',
       pageInfo: '860-867',
       pubType: 'research support, u.s. gov\'t, p.h.s.; research support, non-u.s. gov\'t; research-article; review; journal article',
       isOpenAccess: 'N',
       inEPMC: 'Y',
       inPMC: 'N',
       hasPDF: 'Y',
       hasBook: 'N',
       hasSuppl: 'N',
       citedByCount: 6011,
       hasReferences: 'Y',
       hasTextMinedTerms: 'Y',
       hasDbCrossReferences: 'N',
       hasLabsLinks: 'Y',
       hasTMAccessionNumbers: 'N',
       firstIndexDate: '2010-09-15',
       firstPublicationDate: '2002-12-01' } ] }

where count is the total number of papers.

To change the number of results retrieved at a time, just change the n_papers parameter

pmc.search_papers(query, n_papers = 1, sorting_type = "citation").then((results) => {
  console.log(results.papers[0].abstractText)
})

Getting abstracts

To get the abstract from the first paper, for example, you could do:

pmc.search_papers(query, n_papers = 1, sorting_type = "citation", metadata = "full").then((results) => {

  console.log(results.papers[0].abstractText)


})

It will log:

B and T lymphocytes are the mediators of immunity, but their function is under 
the control of dendritic cells. Dendritic cells in the periphery capture and
process antigens, express lymphocyte co-stimulatory molecules, migrate to 
lymphoid organs and secrete cytokines to initiate immune responses. They not 
only activate lymphocytes, they also tolerize T cells to antigens that are 
innate to the body (self-antigens), thereby minimizing autoimmune reactions. 
Once a neglected cell type, dendritic cells can now be readily obtained in 
sufficient quantities to allow molecular and cell biological analysis. With 
knowledge comes the realization that these cells are a powerful tool for 
manipulating the immune system.