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

datamaid

v0.2.2

Published

Library for making OPeNDAP data 'tidy'

Downloads

6

Readme

datamaid

JavaScript library for taking data and making it tidy (caution, PDF link) which can aid in using the data in tools such a D3.js.

Installation

For use with Node.js, simply install using npm:

$ npm install datamaid

For use with a browser, the source must be checked out from the git repository. After checking out the source code, install the dev dependencies and use npm to compile the source:

$ npm install
$ npm run build

This should generate datamaid.js and the minified datamaid.min.js in the project root. These files can used directly by the browser.

Use

OPeNDAP

OPeNDAP data can be tidied with the datamaid.tidyOPeNDAP method. Load the data using jsdap (or other JavaScript OPeNDAP client). Both the DDS and DODS data are required for tidying.

For example, to load and tidy WSPD data from the OPeNDAP server test site using jsdap and jQuery:

function load() {
	var baseUrl = 'http://test.pydap.org/coads.nc';
	var varName = 'WSPD';

	$.when(
		opendapLoadDatasetDescriptionPromise(baseUrl),
		opendapLoadDataPromise(baseUrl, varName)
	).done(function(ddsData, varData) {
		var tidyData = datamaid.tidyOPeNDAP(varName, ddsData, varData, true);
	});
}

function opendapLoadDatasetDescriptionPromise(url) {
	var deferred = $.Deferred();

	loadDataset(url, function(data) {
		deferred.resolve(data);
	}, '/proxy/');

	return deferred.promise();
}

function opendapLoadDataPromise(url, variable) {
	var deferred = $.Deferred();

	var dodsUrl = url + '.dods?' + variable;

	loadData(dodsUrl, function(data) {
		deferred.resolve(data);
	}, '/proxy/');

	return deferred.promise();
}

Examples

More detailed examples can be found in the examples folder, examples/README.md covers how to run them.

Development

The src is all inside the src directory. To get started with development install the dev dependencies:

$ npm install

You may wish to link eslint into your path for JavaScript linting, assuming development inside a nodeenv:

$ ln -s --relative node_modules/eslint/bin/eslint.js ../bin/eslint

Unit tests are written with Jasmine and run by the Karma test runner. Tests are run against Firefox, Chrome, and Node.js. They can be run using npm:

$ npm run test