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 🙏

© 2024 – Pkg Stats / Ryan Hefner

qsv

v0.5.0

Published

Query CSV and TSV files with a SQL like syntax.

Downloads

46

Readme

Process .csv files with a SQL like syntax.

Build Status codecov Maintainability Mutation Score

Gitter Greenkeeper badge

Work in Progress

Currently supports:

  • SELECT
  • WHERE
  • ORDER BY (single column)
  • LIMIT

qsv demo session

npm install qsv -g

Or if you're using yarn

yarn global add qsv

For files with headers:

qsv -p "./path/to/my/file.csv" -h

For files without headers:

qsv -p "./path/to/my/file.csv"

After loading the file you will get into REPL mode, indicated by the QSV> prompt. In REPL mode you can use SQL Queries against your .csv file.

Examples:

SELECT

SELECT * FROM table
SELECT column1, column2 FROM table

WHERE

Supported operators

| operator | meaning | |----------|-----------------------| | = | Equal | | <> | Not Equal | | > | Greater Than | | < | Less Than | | >= | Greater Than or Equal | | <= | Less Than or Equal |

Examples

SELECT * FROM table WHERE column1 > 10

SELECT * FROM table WHERE column1 < 10

SELECT * FROM table WHERE column1 >= 10

SELECT * FROM table WHERE column1 <= 10

SELECT * FROM table WHERE column1 <> Peter

SELECT * FROM table WHERE colum2 = Mexico

ORDER BY

-- ASC is default for ORDER BY so this
SELECT * FROM table ORDER BY column1
-- is the same as:
SELECT * FROM table ORDER BY column1 ASC
-- For descending order you need to add DESC
SELECT * FROM table ORDER BY column1 DESC

table is just a placeholder, you don't need to specify something that makes sense, just don't leave it blank. column1 and column2 are examples for the header fields.

If your .csv file doesn't have headers omit the -h option. Your table will receive enumerated headers in memory, so you can query it like this:

SELECT 0, 1 FROM table

Options

| Option | Verbose Version | Description | | ------ | --------------- | ------------------------------------------- | | -h | | Indicate that the file to parse has headers | | -d | | Specifiy the delimiter of your file. |