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

qcew

v1.0.3

Published

Interface for querying Bureau of Labor Statistics Quarterly Census of Employment and Wages

Downloads

9

Readme

QCEW

An NodeJs interface for Bureau of Labor Statistics Quarterly Census of Employment and Wages data. For other languages, see the QCEW Open Data Access page. This setup borrows from the Python and PHP/JavaScript examples for code samples and documentation.

Note: I am not affiliated in any way with BLS.

Installation

npm install qcew

Usage

The module has three functions, which you would use as below. For documentation on what the data means, please see the BLS QCEW website and overview, which will have the most up-to-date and in-depth information.

All functions can take an optional format parameter as the last argument to determine the data format you'll receive. If nothing is set, the data will come back as Json. The options are:

  • 'json' — The default and needs not be specified. Returns an array of objects.
  • 'csv' — Returns the data as a csv string — how the API sends it. Useful for writing data to file.
  • 'rows' — Returns an array of arrays representing each row in the data. The first array contains the header values.

getAreaData(year, quarter, area, callback[, format])

This function takes a year, quarter, and area argument and returns data containing the associated area data. Use 'a' for annual averages.

For all area codes and titles see: http://www.bls.gov/cew/doc/titles/area/area_titles.htm

getIndustryData(year, quarter, industry_code, callback[, format])

This function takes a year, quarter, and industry code and returns data containing the associated industry data. Use 'a' for annual averages. Some industry codes contain hyphens. The CSV files use underscores instead of hyphens. So 31-33 becomes 31_33.

For all industry codes and titles see: http://www.bls.gov/cew/doc/titles/industry/industry_titles.htm

getSizeData(year, establishment_size_class_code, callback[, format])

This function takes a year and establishment size class code and returns data containing the associated size data. Size data is only available for the first quarter of each year.

For all establishment size classes and titles see: http://www.bls.gov/cew/doc/titles/size/size_titles.htm

Example

var qcew = require('qcew');

// Data output format can be `json`, `csv` or `rows`. 
// If no value is passed as the last argument, `json` will be returned.
// `rows` will return an array of arrays representing the desired table.

qcew.getAreaData('2013','1','26000', function(err, areaData){
	if (!err){
		console.log(areaData);
	} else {
		console.log(err);
	}
});

qcew.getIndustryData('2013','1','3361', function(err, autoManufacturing){
	if (!err){
		console.log(autoManufacturing);
	} else {
		console.log(err);
	}
}, 'csv');

qcew.getSizeData('2013','6', function(err, sizeData){
	if (!err){
		console.log(sizeData);
	} else {
		console.log(err);
	}
}, 'rows');

License

MIT