Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cut-ordered

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cut-ordered

Like unix's cut(1) except columns can be reordered, and within ~1.3x speed.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cut-ordered

Like a cut(1) that allows reordering of fields.

UNIX cut(1) is a great utility, but I found myself wanting to often reorder fields. This cmd utility attempts to be similar in terms of API to cut(1) but respects the given column order. This is especially useful when wanting to sort data numerically.

Usage

npm install -g cut-ordered
echo 'a b c' | cut-ordered -f 3,2,1 -d ' '
c b a
echo 'a b c' | cut-ordered -f 3,1 -d ' '
c a

Benchmarking

The line parser is a custom compiled function: while gross-looking this means it should execute as quickly as possible (currently about 1.3x as slow as cut(1)). To compare the two:

npm run bench
...

cut

real  0m5.698s
user  0m5.366s
sys 0m0.133s

cut-ordered

real  0m7.646s
user  0m6.717s
sys 0m0.873s

License

MIT

Keywords

FAQs

Package last updated on 17 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc