# datatable.js

> [![Build Status](https://api.travis-ci.org/torpedro/datatable.js.svg?branch=master)](http://travis-ci.org/torpedro/datatable.js) [![npm version](https://badge.fury.io/js/datatable.js.svg)](https://badge.fury.io/js/datatable.js)

Latest version **0.3.6** (published 2017-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install datatable.js
pnpm add datatable.js
yarn add datatable.js
bun add datatable.js
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2017-11-12 |
| First published | 2016-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 12 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Pedro Flemming |
| Maintainers | torpedro |

## Links

- npm: https://www.npmjs.com/package/datatable.js
- Repository: https://github.com/torpedro/datatable.js
- Issues: https://github.com/torpedro/datatable.js/issues
- npm.io page: https://npm.io/package/datatable.js

## Dependencies (12)

- [mocha](https://npm.io/package/mocha.md) ^4.0.1
- [unlog](https://npm.io/package/unlog.md) 0.0.3
- [tslint](https://npm.io/package/tslint.md) ^5.8.0
- [uglify](https://npm.io/package/uglify.md) ^0.1.5
- [papaparse](https://npm.io/package/papaparse.md) ^4.3.6
- [browserify](https://npm.io/package/browserify.md) ^14.5.0
- [typescript](https://npm.io/package/typescript.md) ^2.5.3
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [@types/node](https://npm.io/package/@types/node.md) ^8.0.51
- [@types/mocha](https://npm.io/package/@types/mocha.md) ^2.2.44
- [@types/papaparse](https://npm.io/package/@types/papaparse.md) ^4.1.31
- [@types/underscore](https://npm.io/package/@types/underscore.md) ^1.8.5

## Recent versions

- 0.3.6 (latest) — 2017-11-12
- 0.3.5 — 2017-11-12
- 0.3.4 — 2017-11-12
- 0.3.3 — 2017-11-12
- 0.3.2 — 2016-06-10
- 0.3.1 — 2016-06-10
- 0.3.0 — 2016-06-10
- 0.2.4 — 2016-06-09
- 0.2.3 — 2016-06-03
- 0.2.2 — 2016-06-02
- 0.2.1 — 2016-06-02

## README

[![Build Status](https://api.travis-ci.org/torpedro/datatable.js.svg?branch=master)](http://travis-ci.org/torpedro/datatable.js)
[![npm version](https://badge.fury.io/js/datatable.js.svg)](https://badge.fury.io/js/datatable.js)

# datatable.js - Easy Data Handling

**datatable.js** is an analytics library for JavaScript. The library contains sophisticated implementations of a Table and useful statistical functionality to interact with data. The Table implementation allows **SQL-like** functionality.

# Usage

## Installation

**node.js**: Install the package and import the library.

    npm install datatable.js

    var dt = require("datatable.js")

**Browser**: Include the JavaScript library in your HTML page.

    <script src="dist/datatable.js.min.js"></script>

## Classes

This is a list of all currently publicly usable classes and modules in the library:

 * Table
 * Set
 * HashMap
 * Vector
 * CSVParser

## Examples

Example 1: Creating a table and adding rows to it.

```typescript
var table = new dt.Table({
    fields: ["id", "name", "city", "age"],
    types: ["number", "string", "string", "number"]
});

table.insert([[1, "Max", "Mustermann", 23]]); // works
table.insert([[2, "John", "Doe", 26]]); // works

// throws type-mismatch error
table.insert([[3, "John", "Doe", "blank"]]); 

console.log(table.rows()); // prints an array containing all rows
```

Example 2: Calculate a average age of persons from a city.

```typescript
var table = new dt.Table({
    fields: ["id", "name", "city", "age"],
    types: ["number", "string", "string", "number"]
});

// fill with some data...

var result = table.groupBy("city", table.agg.avg("age", "average_age");
console.log(result.rows());
```


# Contributing / Development

```bash
# install dependencies
npm install

# build the library
grunt build

# run mocha tests
grunt test

# run linter
grunt test-and-lint

# create minified sources
grunt release
```

---
_Source: https://npm.io/package/datatable.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
