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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mikosoft/csv

v1.2.2

Published

Nodejs library which helps with CSV file management.

Readme

@mikosoft/csv

Nodejs library which helps with CSV file management.

The library acts as a lightwight database with CSV files.

Installation

$ npm install --save @mikosoft/csv

Example

/*** NodeJS script ***/
const CSV = require('@mikosoft/csv');

const func = async () => {

  const csvOpts = {
    filePath: './appended_arr.csv',
    encoding: 'utf8',
    mode: 0o644,

    fields: ['url', 'name', 'size'], // only these fields will be effective
    fieldDelimiter: ',',
    fieldWrapper: '"',
    rowDelimiter: '\n'
  };
  const csv = new CSV(csvOpts);

  const rows = await csv.readRows(false); // all types will be string
  // const rows = await csv.readRows(true); // or just csv.readRows()
  console.log('rows in total:: ', rows.length);
  console.log(JSON.stringify(rows, null, 4));
};

func().catch(console.error);

API

constructor(opts) :void

const CSV = require('csvman);

const opts = {
  filePath: './input.csv',
  encoding: 'utf8',
  mode: '0664',
  fields: ['url', 'name'], // define active CSV fields
  fieldDelimiter: ',',
  fieldWrapper: '"',
  rowDelimiter: '\n'
}
const csv = new CSV(opts);

async createFile() :void

Create CSV file defined in opts.filePath if it does not exist. If the file exists, it is NOT MODIFIED.

async addHeader() :void

Add fields into the CSV Header. Only if the file is empty.

async writeRows(rows:array) :void

Write multiple CSV rows. The rows argument is an array of objects. CAUTION: Old content will be overwritten when this method is used.

async appendRows(rows:array) :void

Append multiple CSV rows. The rows argument is an array of objects. New content will be added to the old content.

async readRows(convertType: boolean) :array

Read CSV rows and convert it in the array of objects. If convertType is true then fields will convert the type automatically, for example string '5' will become number 5. The default is true.

async updateRows(query:object, doc:object, upsert:boolean) :{count:number, rows_updated: object[]}

Find CSV row by query and update it with doc. The query is inspired by MongoDB queries so it can use.

$eq, $ne, $gt, $gte, $lt, $lte, $regex, $in, $exists

For example: {name: {$regex: /john/i}}

The doc is object whose properties are CSV fields. If the upsert is true insert a new row if the rows are not found by the query.

async findRows(query) :object[]

Find CSV rows by the query. Use MongoDb inspired queries.

async removeRows(query) :object[]

Find and remove CSV rows by the query. Use MongoDb inspired queries. The returned value is the array of removed row objects.

async extractFields() :array

Get fields array from the first (header) row.

fileExists() :boolean

Check if the CSV file defined in opts.filePath exists.

License

The software licensed under MIT.