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 🙏

© 2025 – Pkg Stats / Ryan Hefner

native-data.js

v0.0.8

Published

Native JavaScript Array Library for Data Manipulation and Analysis.

Readme

Native JavaScript Array Library

npm license NPM downloads

Data is Native JavaScript Array library for data manipulation and analysis.

Key Feature:

  • Simplicity: Works with 2D arrays like a spreadsheet, making it simple and straightforward.
  • User-Friendly: Easy-to-read syntax inspired by Python and R, with methods that are intuitive and clean.
  • Clear Data Display: The print() method shows data in a clean table format for quick understanding.
  • Native to JavaScript: Fully compatible with JavaScript projects and works seamlessly.
  • Convertible: Easily converts data into objects or other formats for flexible use in various applications.
  • Customizable: Data.js adopts an object-oriented design, making it easier to extend, modify, and build.

Documentation

Instance Methods

Create new Data

const x = new Data(
    array=[["Getser", "Microsoft", 7, 28], ["Wikan", "Google", 8, 27], ["Miki", "Bitcoin", 9, 29]], 
    cols=["name", "company", "score", "age"]
);

Print

print() is print data to console and return the Data instance.

x.print();
print:1
----------------------------------------
|   | name   | company   | score | age | 
----------------------------------------
| 0 | Getser | Microsoft | 7     | 28  | 
| 1 | Wikan  | Google    | 8     | 27  | 
| 2 | Miki   | Bitcoin   | 9     | 29  | 
----------------------------------------

Get Print

getPrint() is return print text as string, useful for showing the result in the front end.

Get Array

getArray() is return array of the Data instance.

x.getArray(); // [["Getser", "Microsoft", 7, 28], ["Wikan", "Google", 8, 27], ["Miki", "Bitcoin", 9, 29]]

Get Col Names

getColNames() is return column names of the Data instance.

x.getColNames(); // ['name', 'company', 'score', 'age']

Get Col Data Types

getColDataTypes() return column data types dictionary.

x.getColDataTypes().name; // string

Get Object

getObject() is return column object of the Data instance.

Get array object property value to object which using column names as key.

const y = x.getObject();
y.company; // ['Microsoft', 'Google', 'Bitcoin']
y.name; // ['Getser', 'Wikan', 'Miki']

Get Row

getRow(row:int) is return selected row of the array in the Data instance.

x.getRow(1); // ['Wikan', 'Google', 8, 27]

Get Column

getColumn(col:str) is return selected column of the array in Data instance.

x.getCol('company'); // ['Microsoft', 'Google', 'Bitcoin']

Get Cell

getCell(row:int, col:str) is return selected cell of the array in Data instance.

x.getCell(row=1, col="company"); // 'Google'

Get Size

getSize() is return size [nrow, ncol] of the array in Data instance.

x.getSize(); // [3, 4]

Rename Col

renameCol(oldName:str, newName:str) is rename the column name and return the Data instance.

const y = new Data(
    array=[["Getser", "Microsoft", 7, 28], ["Wikan", "Google", 8, 27], ["Miki", "Bitcoin", 9, 29]], 
    cols=["name", "company", "score", "age"]
);

y.print().renameCol(oldName="score", newName="employment_time").print();
print:1
----------------------------------------
|   | name   | company   | score | age | 
----------------------------------------
| 0 | Getser | Microsoft | 7     | 28  | 
| 1 | Wikan  | Google    | 8     | 27  | 
| 2 | Miki   | Bitcoin   | 9     | 29  | 
----------------------------------------
print:2
--------------------------------------------------
|   | name   | company   | employment_time | age | 
--------------------------------------------------
| 0 | Getser | Microsoft | 7               | 28  | 
| 1 | Wikan  | Google    | 8               | 27  | 
| 2 | Miki   | Bitcoin   | 9               | 29  | 
--------------------------------------------------

Drop Col

dropCol(col:str) is drop the column and return Data instance.

const z = new Data(
    array=[["Getser", "Microsoft", 7, 28], ["Wikan", "Google", 8, 27], ["Miki", "Bitcoin", 9, 29]], 
    cols=["name", "company", "score", "age"]
);

z.print().dropCol("score").print();
print:1
----------------------------------------
|   | name   | company   | score | age | 
----------------------------------------
| 0 | Getser | Microsoft | 7     | 28  | 
| 1 | Wikan  | Google    | 8     | 27  | 
| 2 | Miki   | Bitcoin   | 9     | 29  | 
----------------------------------------
print:2
--------------------------------
|   | name   | company   | age | 
--------------------------------
| 0 | Getser | Microsoft | 28  | 
| 1 | Wikan  | Google    | 27  | 
| 2 | Miki   | Bitcoin   | 29  | 
--------------------------------

Drop Row

dropRow(row:int) is drop the row and return Data instance.

const z = new Data(
    array=[["Apple", 10, 1], ["Orange", 2, 2],["Lecy", 20, 3]],
    cols=["fruit", "quantity", "price_usd"]
);

z.print().dropRow(1).print();
print:1
-------------------------------------
|   | fruit  | quantity | price_usd | 
-------------------------------------
| 0 | Apple  | 10       | 1         | 
| 1 | Orange | 2        | 2         | 
| 2 | Lecy   | 20       | 3         | 
-------------------------------------
print:2
------------------------------------
|   | fruit | quantity | price_usd | 
------------------------------------
| 0 | Apple | 10       | 1         | 
| 1 | Lecy  | 20       | 3         | 
------------------------------------

Copy

copy() is duplicate and return to new Data instance.

Copy the object from another object, make data manipulation and analysis much easier.

const x = new Data(
    array=[["Apple", 10, 1], ["Orange", 2, 2],["Lecy", 20, 3]],
    cols=["fruit", "quantity", "price_usd"]
);

const y = x.copy().dropCol("price_usd");

y.print()
x.print()
print:1
-------------------------
|   | fruit  | quantity | 
-------------------------
| 0 | Apple  | 10       | 
| 1 | Orange | 2        | 
| 2 | Lecy   | 20       | 
-------------------------
print:2
-------------------------------------
|   | fruit  | quantity | price_usd | 
-------------------------------------
| 0 | Apple  | 10       | 1         | 
| 1 | Orange | 2        | 2         | 
| 2 | Lecy   | 20       | 3         | 
-------------------------------------