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

dat-rest-server

v1.0.6

Published

An http server for [dat](http://dat-data.com).

Readme

dat-rest-server

A http server for dat. Parameters to routes are the same as the cli documentation.

npm install -g dat-rest-server
dat-rest-server --port=<port> --path=<path/to/dat>

GET /

Gets basic information about the state of the dat

{
  dat: true,
  version: "7.0.4",
  status: {
    head: "a2c77bedfb59f2237825614b57109ef35e097f5b1bf9320e9a52ef90768d566a",
    transaction: false,
    checkout: false,
    modified: "2015-09-01T22:53:17.775Z",
    datasets: 3,
    rows: 2686,
    files: 2,
    versions: 4,
    size: 1704743
  },
  datasets: [
    "organisms2",
    "organisms",
    "files"
  ]
}

POST /

Used for replication during clone:

dat clone mydatserver.com

GET /datasets

GET mydatserver.com/datasets

Returns

[
  "files",
  "sac-crime",
  "models"
]

GET /changes

Gets changes from dat

Optional params: live

GET mydatserver.com/changes?live=true

Returns

{"root":true,"change":1,"date":"2015-09-01T20:47:40.582Z","version":"3ffbf6b75e57a934024c47e747390732bb0b8210310b037bb4974b5529820ea9","message":"","links":[],"puts":0,"deletes":0,"files":0}
{"root":false,"change":2,"date":"2015-09-01T20:47:40.590Z","version":"dbf404f13567d5dd727534b80816b1b95211523611410024bafb53a3831f0f18","message":"","links":["3ffbf6b75e57a934024c47e747390732bb0b8210310b037bb4974b5529820ea9"],"puts":1,"deletes":0,"files":1}
{"root":false,"change":3,"date":"2015-09-01T20:47:45.274Z","version":"969be9bd7e4670633e1b8412f9617311c80b6e3aec6d6013de15b705292fcb28","message":"","links":["dbf404f13567d5dd727534b80816b1b95211523611410024bafb53a3831f0f18"],"puts":1342,"deletes":0,"files":0}
{"root":false,"change":4,"date":"2015-09-01T22:52:45.479Z","version":"2e8cd3a9578e9a5281768d8a7625adc2c7e99d60660fde5a8807205240d89601","message":"","links":["969be9bd7e4670633e1b8412f9617311c80b6e3aec6d6013de15b705292fcb28"],"puts":1,"deletes":0,"files":1}
{"root":false,"change":5,"date":"2015-09-01T22:53:17.775Z","version":"a2c77bedfb59f2237825614b57109ef35e097f5b1bf9320e9a52ef90768d566a","message":"complete->completed","links":["2e8cd3a9578e9a5281768d8a7625adc2c7e99d60660fde5a8807205240d89601"],"puts":1342,"deletes":0,"files":0}

GET /files

Get file list from dat.

GET mydatserver.com/files
{
  files: [
    "/Users/karissa/Dropbox/throwaway/bug.mov",
    "asdf",
    "black_crappie.json",
    "bug.mov",
    "fishing/black_crappie.json",
    "fishing/yellow_perch.json",
    "package.json"
  ]
}

GET /files/:name

Get file contents with the given name

GET mydatserver.com/files/package.json
{
  name: "Hunting-and-Fishing",
  publisher: "waldoj",
  description: "Hunting-and-Fishing"
}

GET /datasets/:name

Gets dat data out.

Optional params: format

GET mydatserver.com/datasets/<dataset>?format=csv

Returns

cdatetime,address,district,beat,grid,crimedescr,ucr_ncic_code,latitude,longitude
1/1/06 0:00,3108 OCCIDENTAL DR,3,3C        ,1115,10851(A)VC TAKE VEH W/O OWNER,2404,38.55042047,-121.3914158
1/1/06 0:00,2082 EXPEDITION WAY,5,5A        ,1512,459 PC  BURGLARY RESIDENCE,2204,38.47350069,-121.4901858
1/1/06 0:00,4 PALEN CT,2,2A        ,212,10851(A)VC TAKE VEH W/O OWNER,2404,38.65784584,-121.4621009
1/1/06 0:00,22 BECKFORD CT,6,6C        ,1443,476 PC PASS FICTICIOUS CHECK,2501,38.50677377,-121.4269508
1/1/06 0:00,3421 AUBURN BLVD,2,2A        ,508,459 PC  BURGLARY-UNSPECIFIED,2299,38.6374478,-121.3846125
1/1/06 0:00,5301 BONNIEMAE WAY,6,6B        ,1084,530.5 PC USE PERSONAL ID INFO,2604,38.52697863,-121.4513383
1/1/06 0:00,2217 16TH AVE,4,4A        ,957,459 PC  BURGLARY VEHICLE,2299,38.537173,-121.4875774
1/1/06 0:00,3547 P ST,3,3C        ,853,484 PC   PETTY THEFT/INSIDE,2308,38.56433456,-121.4618826
1/1/06 0:00,3421 AUBURN BLVD,2,2A        ,508,459 PC  BURGLARY BUSINESS,2203,38.6374478,-121.3846125
1/1/06 0:00,1326 HELMSMAN WAY,1,1B        ,444,1708 US   THEFT OF MAIL,2310,38.60960217,-121.4918375

POST /datasets/:dataset

Put data in dat.

Optional params: message, format, key.

POST mydatserver.com/datasets/<dataset>

Be sure to push data in the request with an appropriate Content-Type header:

'json': 'application/json',
'csv': 'text/csv',
'ndjson': 'application/x-ndjson',
'sse': 'text/event-stream'