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

klp-dsv

v0.1.0

Published

TODO: Add klp-dsv teaser

Downloads

52

Readme

TODO: Add klp-dsv teaser

:horse:klp-dsv is a delimiter-separated values plugin for klp (Kelpie), the small, fast, and magical command-line data processor.

See the klp github repository for more details!

node version npm version license PRs Welcome linux unit tests status macos unit tests status windows unit tests status

Installation

:ok_hand: klp-dsv comes preinstalled in klp. No installation necessary. If you still want to install it, proceed as described below.

klp-dsv is installed in ~/.klp/ as follows:

npm install klp-dsv

The plugin is included in ~/.klp/index.js as follows:

const dsv = require('klp-dsv')

module.exports = {
  plugins:  [dsv],
  context:  {},
  defaults: {}
}

For a much more detailed description, see the .klp module documentation.

Extensions

This plugin comes with the following klp extensions:

| | Description | |--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | dsv deserializer | Deserializes delimiter-separated values files. The delimiter, quote, and escape characters, as well as several other options make it very flexible. | | csv deserializer | Deserializes comma-separated values files. Follows RFC4180 for the most part. Uses dsv internally and accepts the same options. | | tsv deserializer | Deserializes tab-separated values files. Useful for processing tabular database and spreadsheet data. Uses dsv internally and accepts the same options. | | ssv deserializer | Deserializes space-separated values files. Useful for processing command line output from ls, ps, and the like. Uses dsv internally and accepts the same options. | | csv serializer | Serializes JSON into CSV format. |

Limitations

This plugin has the following limitations:

  1. No type casting: The deserializers do not cast strings to other data types, like numbers or booleans. This is intentional. Since different use cases need different data types, and some use cases need their integers to be strings, e.g. in case of IDs, there is no way to know for sure when to cast a string to another type. If you need different types, you may cast strings by using appliers.
  2. Integer header order: Headers that are integers are always printed before other headers. This is an implementation detail of the way JavaScript orders object keys internally. Although this is an inconvenience, this behaviour will stay for now, since changing it would reduce performance. If you have a good way to solve this and retain performance, please let me know.
  3. Non-optimal tsv (de-)serializer implementations: The tsv deserializer is implemented in terms of the dsv deserializer and thus supports quotes and escaping tabs. Other implementations of tsv deserializers do not allow tabs in values and thus have no need of quotes and escapes. This means, the current tsv implementation works just fine, but an implementation without quotes should be faster. Such an implementation may come at some point in the future.
  4. No multi-line CSV files: The csv deserializer does not support multi-line values, aka values with line breaks inside quotes. Actually, no klp deserializer could support this feature on its own, since it is the chunkers' responsibility to chunk data. Currently there is no dedicated chunker that supports chunking multi-line csv files, but there may be in the future.

Reporting Issues

Please report issues in the tracker!

License

klp-dsv is MIT licensed.