Coder Social home page Coder Social logo

edfjs's Introduction

edfjs

Lint Unit E2E

A lean javascript implementation of European Data Format.

Installation

Install with npm

To use the library for your website, you can install the npm package:

npm i edfjs

Use it in your javascripts, e.g., with:

const fs = require('fs');
const edfjs = require("edfjs");
const edf = new edfjs.EDF();
const fp = fs.readFileSync("./examples/sample.edf");
edf.read_buffer(fp.buffer);

Include module from CDN

The module can be used in your webpage by including the following link from jsdelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/edfjs@latest/dist/edf.min.js"></script>

Build the module locally

Browserify and Minify is used to build the module as a standalone library so that you can import it into your own scripts. To build, git-clone yourself a local copy of master ``, cd edfjs, and build it with npm using `npm run build`:

git clone https://github.com/jusjusjus/edfjs.git
cd edfjs
npm install --only=dev
npm run build

A stand-alone version of the library, ./dist/edf.min.js, should appear. Before you need to install other dependencies.

Usage

In ./web, we give an example usage of edfjs directly included in an html document. Build the minified module using npm run build, start serving ./web/index.html and load an edf file for demo.

Tests

To test run:

npm run test

Jest

If you encounter trouble testing your code that uses edfjs (By default "node_modules" folder is ignored by transformers), please add a "jest.config.js" to your project with the following content:

const esModules = ['edfjs'].join('|');
module.exports = {
  transformIgnorePatterns: [`/node_modules/(?!${esModules})`]
}

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

edfjs's People

Contributors

jusjusjus avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.