How to use the trim-newlines.end function in trim-newlines

To help you get started, we’ve selected a few trim-newlines examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github panda-lang / reposilite / reposilite-cli / app / reposilite-backend.js View on Github external
this.backend.stdout.on('data', (data) => {
            let message = data.toString()

            if (requiresNL) {
                message = "\n" + message
                requiresNL = false
            }

            if (message.endsWith("\n")) {
                requiresNL = true
                message = trim.end(message)
            }

            process.stdout.write(message.replace(/\n/g, "\n[reposilite-backend] "))
        })
github silklabs / silk / bsp-gonk / vendor / silk / silk-sysutils / index.js View on Github external
get(prop: string): string {
      let result = spawnSync('getprop', [prop], {encoding: 'utf8'});
      if (result.stdout) {
        return trimNewLinesAtEnd(result.stdout.toString());
      }
      return '';
    },
    set(prop: string, value: string): void {

trim-newlines

Trim newlines from the start and/or end of a string

MIT
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Popular trim-newlines functions