Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 25, 2024 via pnpm

braces 3.0.2

Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.
Package summary
Share
0
issues
1
license
4
MIT
Package created
20 Oct 2014
Version published
16 Apr 2019
Maintainers
3
Total deps
4
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
braces@3.0.2
fill-range@7.0.1
is-number@7.0.0
to-regex-range@5.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of braces 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
fill-range7.0.15.44 kBMIT
prod

Visualizations

Frequently Asked Questions

What does braces do?

Braces is a JavaScript library that implements Bash-like brace expansion. This library enables users to safely generate and match brace patterns. It offers complete support for the Bash 4.3 braces specification and is designed to be fast and efficient without compromising on safety. This makes it an ideal choice when dealing with brace patterns in JavaScript, as it can prevent aggressive or malicious brace patterns from breaking your application, such as those that could be used for DDoS attacks.

How do you use braces?

You can use the braces library by first installing it with npm using the following command: npm install --save braces. Once installed, you can require it in your JavaScript file and use it like so:

const braces = require('braces');

console.log(braces(['{01..05}', '{a..e}']));
//=> ['(0[1-5])', '([a-e])']

console.log(braces(['{01..05}', '{a..e}'], { expand: true }));
//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e']

The main export is a function that takes one or more brace 'patterns' and 'options'. By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. You can set the expand option to true if you want to enable brace expansion, which returns an array similar to what you'd expect from Bash. Additionally, it supports lists (aka "sets"), sequences (aka "ranges"), steps (aka "increments"), and escaping.

Where are the braces docs?

The official documentation for the braces library is in its README file, which is available on the project's GitHub page. You can visit the URL git+https://github.com/micromatch/braces.git to access the complete documentation. This includes detailed explanations on the use of the brace library, its options and different use-cases it supports, performance considerations, among others.