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

jsdap

v8.1.0

Published

A JavaScript OPeNDAP client

Downloads

663

Readme

jsdap

A JavaScript OPeNDAP client.

Installation

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

:::bash
$ npm install jsdap

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:

:::bash
$ npm install
$ npm run build

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

Use

The API is as simple as it gets:

:::js
jsdap.loadDataset(url, callback [, proxy]);

This will load the metadata from an OPeNDAP url, and return it to your callback function as a JavaScript object identical to pydap's JSON response (http://pydap.org/2.x/responses/json.html).

Note that if the server is on a different domain you need to specify a proxy to handle the requests. There's a simple proxy written in Python contained in examples/ajaxproxy.py.

To load dods data:

:::js
jsdap.loadData(url, callback [, proxy]);

This reads the data from a .dods URL (http://example.com/dataset.dods?var1,var2&var3>0), returning it as a nested list. This is the data for the whole dataset, so the outer list corresponds to the dataset objects, and each contained list is the data of a given variable, an so on recursively.

:::js
jsdap.loadDataAndDDS(url, callback [, proxy]);

This reads the data from a .dods URL (http://example.com/dataset.dods?var2,var1&var3>0), returning an object with a dds property containing a JavaScript object equivalent to the DDS for the given query, and a data property containing the requested data as a nested list. This can be useful when a projection changes the order of the returned data.

Examples

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

Limitations

Due to the XHR policy on not allowing cross-domain requests, you need a proxy to handle external datasets.

Dods data is parsed using an ArrayBuffer, so IE 9 and below are not supported.

Development

Jsdap is composed of 3 separate files: parser.js, xdr.js, and api.js. They are located within the src directory.

It is recommended to develop in a virtualenv with nodeenv installed:

:::bash
$ virtualenv jsdap
$ cd jsdap
$ source bin/activate
$ pip install nodeenv

Install the latest node and set nodeenv to activate with the parent virtualenv:

:::bash
$ nodeenv -p

Checkout the source and install the requirements in the nodeenv:

:::bash
$ git clone [email protected]:jetfuse/jsdap.git
$ cd jsdap
$ npm install

To get started with development install the dev dependencies:

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

:::bash
$ 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:

:::bash
$ npm run test

License

Jsdap is (c) 2007--2009 Roberto De Almeida, licensed under the MIT license.

References