JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6091
  • Score
    100M100P100Q121281F
  • License ISC

Package Exports

  • node-balanced

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-balanced) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Balanced

allows you to replace the contents inside of your own balanced constraints.

example time

lets say you have

{
    @hello 1 {
        a {
            b {
                c {

                }
            }
        }
    }
    @hello 2 {
        a {
            b {
                c {

                }
            }
        }
    }
    @hello 3 {
        a {
            b {
                c {

                }
            }
        }
    }
}

and you would like to replace the @hello block easily, balanced allows you to do this

balanced.replacements({
    source: source,
    start: /@hello \d \{/,
    right: '{',
    left: '}',
    replace: function (source, opening, closing) {
        return opening + source + closing;
    }
});

this is a simple and efficient way to make balanced replacements, without a parser.