How to use estrella - 4 common examples

To help you get started, we’ve selected a few estrella 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 rsms / gotalk / js / build.js View on Github external
jsbuf.subarray(0, i),
    Buffer.from(`if(typeof module!="undefined")module.exports=gotalk;\n`),
    jsbuf.subarray(i),
  ])

  // go source with embedded js
  let goSource = `
  package gotalk

  const JSLibSHA1Base64 = "${sha1(jsbuf1, 'base64')}"
  const JSLibString = ${bytesToGoString(jsbuf1)}
  `.trim().replace(/\n +/g,"\n") + "\n"

  await Promise.all([
    file.write(config.outfile, jsbuf2),
    file.write("../jslib.go", goSource, {log:true}),
  ])
}
github rsms / gotalk / js / build.js View on Github external
let jsbuf2 = Buffer.concat([
    jsbuf.subarray(0, i),
    Buffer.from(`if(typeof module!="undefined")module.exports=gotalk;\n`),
    jsbuf.subarray(i),
  ])

  // go source with embedded js
  let goSource = `
  package gotalk

  const JSLibSHA1Base64 = "${sha1(jsbuf1, 'base64')}"
  const JSLibString = ${bytesToGoString(jsbuf1)}
  `.trim().replace(/\n +/g,"\n") + "\n"

  await Promise.all([
    file.write(config.outfile, jsbuf2),
    file.write("../jslib.go", goSource, {log:true}),
  ])
}
github rsms / gotalk / js / build.js View on Github external
async function postProcess(config, diagnostics) {
  let jsbuf = await file.read(config.outfile)

  // find sourceMappingURL
  let sourceMappingURLBuf = Buffer.from("//# sourceMappingURL")
  let i = jsbuf.indexOf(sourceMappingURLBuf)
  if (i == -1) { throw new Error("could not find '//# sourceMappingURL' in gotalk.js") }

  // js without sourcemap url
  let jsbuf1 = jsbuf.subarray(0, i)

  // js with nodejs compat code added
  let jsbuf2 = Buffer.concat([
    jsbuf.subarray(0, i),
    Buffer.from(`if(typeof module!="undefined")module.exports=gotalk;\n`),
    jsbuf.subarray(i),
  ])
github rsms / gotalk / js / build.js View on Github external
// js without sourcemap url
  let jsbuf1 = jsbuf.subarray(0, i)

  // js with nodejs compat code added
  let jsbuf2 = Buffer.concat([
    jsbuf.subarray(0, i),
    Buffer.from(`if(typeof module!="undefined")module.exports=gotalk;\n`),
    jsbuf.subarray(i),
  ])

  // go source with embedded js
  let goSource = `
  package gotalk

  const JSLibSHA1Base64 = "${sha1(jsbuf1, 'base64')}"
  const JSLibString = ${bytesToGoString(jsbuf1)}
  `.trim().replace(/\n +/g,"\n") + "\n"

  await Promise.all([
    file.write(config.outfile, jsbuf2),
    file.write("../jslib.go", goSource, {log:true}),
  ])
}

estrella

Versatile build tool based on the esbuild compiler

ISC
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis