Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

brace-compression

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brace-compression

Reverse brace expansion (like sh/bash)

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

brace-compression

Reverse brace expansion (like sh/bash)

Warnings

  • the output is not escaped or necessarily safe to parse using the shell - this is just meant to compress data for human-readable purposes.
  • may not work in every case
  • output is an array

Example

var compress = require('brace-compression');
var data = [
    'foo-1',
    'foo-2',
    'foo-3'
];

var s = compress(data).join(' ');
console.log(s);
// => "foo-{1..3}"

The input array should be sorted before being passed to compress

CLI

$ cat file.txt
foo-1
foo-2
foo-3
$ cat file.txt | brace-compress
foo-{1..3}

Installation

npm install [-g] brace-compression

License

MIT License

Keywords

sh

FAQs

Package last updated on 26 Mar 2021

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