Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-brace-compression
Reverse brace expansion (like sh/bash)
https://github.com/bahamas10/node-brace-compression
Last synced: about 2 months ago
JSON representation
Reverse brace expansion (like sh/bash)
- Host: GitHub
- URL: https://github.com/bahamas10/node-brace-compression
- Owner: bahamas10
- Created: 2015-04-29T07:35:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-26T07:52:17.000Z (over 3 years ago)
- Last Synced: 2024-10-12T20:29:22.603Z (2 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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 arrayExample
-------``` js
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