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 🙏

© 2026 – Pkg Stats / Ryan Hefner

datapackage-query

v0.1.8

Published

Opens datapackage.json and resource.csv files and performs simple queries on the contents

Downloads

13

Readme

DataPackage Query

NPM

Opens datapackage.json and contained resource.csv files and performs various search queries on the contents.

npm install datapackage-query

Getting Started

Include package and perform a basic query with arguments. In this case the arguments are the type key and search

var Query = require('datapackage-query')

var arguments = { country: 'SY', 'search': 'DarkCo' }

Query.Grow('/path/to/your/datapackage.json', function(schema) {
  Query.Twirl('/path/to/datapackage/', schema.resources[0], arguments, function(csv_to_json_data) {
    // use your data for good :)
   })
})

Arguments

search filters results by wild card search term specified

key filters results by "key" in a datapackage's schema to the specified value of query

Examples

Here is an example of datapackage-query being used to power digitalfreedom.io website which creates a REST API using ConjurorAPI which exposes the data through the Hapi.js webserver.

Example: retrieve all surveillance vendors based in Germany:

curl "https://digitalfreedom.io/api/vendors?country=DE" | python -m json.tool

Example: retrieve all targeted attacks related to Syria that have employed the DarkComet RAT:

curl "https://digitalfreedom.io/api/targetedthreats?country=SY&family=DarkCo" | python -m json.tool
curl "https://digitalfreedom.io/api/vendors?country=DE&search=Trojan" | python -m json.tool

REST API Query Result

$ curl https://digitalfreedom.io/api/targetedthreats | python -m json.tool
{
    "description": "Targeted attacks related to civil society",
    "homepage": "",
    "license": "PDDL-1.0",
    "name": "data-targetedthreats",
    "repository": "https://github.com/digitalfreedom/data-targetedthreats.git",
    "result": [
        {
            "c2": "213.55.99.74",
            "country": "ET",
            "date": "2012-01-01",
            "family": "FinSpy",
            "md5": "8ae2febe04102450fdbc26a38037c82b",
            "reference": "https://citizenlab.org/2013/03/you-only-click-twice-finfishers-global-proliferation-2/",
            "target": "opposition"
        },
        {
            "c2": "46.4.69.25",
            "country": "ET",
            "date": "2013-12-01",
            "family": "RCS",
            "md5": "53a9e1b59ff37cc2aeff0391cc546201",
            "reference": "https://citizenlab.org/2014/02/hacking-team-targeting-ethiopian-journalists/",
            "target": "journalist"
        },
        ...
    ],
    "status": "success",
    "title": "Targeted Threats",
    "version": "0.1.0"
}