New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

netcdf

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netcdf

Read NetCDF files in the browser or with Node.js

latest
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

NetCDF

Read NetCDF files in the browser or with Node.js

Supported

  • NetCDF Classic Format
  • Reading only at this stage
  • 64bit Offsets (with caveats)
  • Reading all record variables
  • Reading a non-record variable

Todo

  • Browser support
  • Querying
  • Tests
  • Writing NetCDF

Example

var readstream = require('netcdf/fs/readstream');
var readrandom = require('netcdf/fs/readrandom');
var netcdf = require('netcdf');

var file = './examples/WMI_Lear.nc';
var headerbuffer = readstream(file);

// Read the header of a NetCDF file
netcdf.readheader(headerbuffer, function(header) {
  console.log(JSON.stringify(header, null, 2));
  
  var randombuffer = readrandom(file);
  
  // Read a variable
  netcdf.readvariable(header, randombuffer, 'lat', function(err, data) {
    if (err != null) {
      return console.error(err);
    }
    console.log(data);
  });
  
  // Read records
  netcdf.readrecords(header, randombuffer, function(err, data) {
    if (err != null) {
      return console.error(err);
    }
    console.log(data);
  });
});

FAQs

Package last updated on 20 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts