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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@datafire/citycontext

v6.0.0

Published

DataFire integration for City Context

Readme

@datafire/citycontext

Client library for City Context

Installation and Usage

npm install --save @datafire/citycontext
let citycontext = require('@datafire/citycontext').create({
  user_key: ""
});

.then(data => {
  console.log(data);
});

Description

City Context provides a straightforward API to access UK Open Data: crime statistics, schools, demographics and more.

Actions

byPoint

Query by coordinates (SRID 4326 - decimal degrees)

citycontext.byPoint({
  "lat": 0,
  "lon": 0
}, context)

Input

  • input object
    • lat required number: Latitude
    • lon required number: Longitude
    • school_search_radius integer: Search radius for schools, in metres, between 100 and 4000
    • park_search_radius integer: Search radius for parks, in metres, between 100 and 2000

Output

byPostcode

Query by postcode

citycontext.byPostcode({
  "postcode": ""
}, context)

Input

  • input object
    • postcode required string: Postcode
    • school_search_radius integer: Search radius for schools, in metres, between 100 and 4000
    • park_search_radius integer: Search radius for parks, in metres, between 100 and 2000

Output

usage

Get usage in current month

citycontext.usage(null, context)

Input

This action has no parameters

Output

Definitions

Latlon

Location

  • Location object: Latitude, Longitude and other info related to the given point
    • lat required number
    • lon required number
    • withinLondonCCZ boolean: Boolean flag indicating whether this point is located within London's Congestion Charge zone

PointInfo

  • PointInfo object: Contextual information around a given point
    • location required Location
    • lsoa object: Statistics for lower layer super output areas (LSOA)
      • crimes object
      • name required string
      • population object
        • allUsualResidents required integer
        • communalEstablishmentResidents required integer
        • householdResidents required integer
        • households required integer
        • personsPerHectare required integer
        • personsPerHousehold required integer
    • parks required array: Parks within 1km of the point of interest, sorted by descending area
      • items object
        • areaSqm required integer
        • centroid required Latlon
        • distanceMeters required integer
        • name string
    • schools required array: Schools within 1km of the point of interest, sorted by ascending distance from the POI
      • items object
        • distanceMeters required integer
        • lastInpectionUrl required string: URL to the last inspection report
        • lastInspectionDate required string: Date of the last Ofsted inspection
        • leadershipAndManagement required integer: Leadership and management grade in the last Ofsted report, from 1 (outstanding) to 4 (inadequate)
        • location required Latlon
        • overallEffectiveness required integer: Overall effectiveness grade in the last Ofsted report, from 1 (outstanding) to 4 (inadequate)
        • phase required string
        • qualityOfTeaching required integer: Quality of teaching grade in the last Ofsted report, from 1 (outstanding) to 4 (inadequate)
        • schoolName required string
        • typeOfEstablishment required string
        • urn required integer: Unique school identifier

Usage

  • Usage object: User plan monthly API quota and usage
    • allowance integer
    • period required string
    • periodEnd required string
    • periodStart required string
    • plan required string
    • usage required integer