How to use chromium-pickle-js - 10 common examples

To help you get started, we’ve selected a few chromium-pickle-js 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 cellardoor42 / whatever / node_modules / electron-packager / node_modules / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function (dest, filesystem, files, metadata, callback) {
  let sizeBuf
  let headerBuf
  try {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(filesystem.header))
    headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    sizeBuf = sizePickle.toBuffer()
  } catch (error) {
    return callback(error)
  }

  const out = fs.createWriteStream(dest)
  out.on('error', callback)
  out.write(sizeBuf)
  return out.write(headerBuf, function () {
    return writeFileListToStream(dest, filesystem, out, files, metadata, callback)
  })
}
github onmyway133 / PushNotifications / node_modules / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function (dest, filesystem, files, metadata, callback) {
  let sizeBuf
  let headerBuf
  try {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(filesystem.header))
    headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    sizeBuf = sizePickle.toBuffer()
  } catch (error) {
    return callback(error)
  }

  const out = fs.createWriteStream(dest)
  out.on('error', callback)
  out.write(sizeBuf)
  return out.write(headerBuf, function () {
    return writeFileListToStream(dest, filesystem, out, files, metadata, callback)
  })
}
github electron-userland / electron-builder / src / asarUtil.ts View on Github external
private writeAsarFile(): Promise {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(this.fs.header))
    const headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    const sizeBuf = sizePickle.toBuffer()

    const writeStream = createWriteStream(this.outFile)
    return new BluebirdPromise((resolve, reject) => {
      writeStream.on("error", reject)
      writeStream.once("finish", resolve)
      writeStream.write(sizeBuf)

      let w: (list: Array, index: number) => void
      w = (list: Array, index: number) => {
        if (list.length === index) {
          writeStream.end()
          return
        }
github onmyway133 / PushNotifications / node_modules / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function (dest, filesystem, files, metadata, callback) {
  let sizeBuf
  let headerBuf
  try {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(filesystem.header))
    headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    sizeBuf = sizePickle.toBuffer()
  } catch (error) {
    return callback(error)
  }

  const out = fs.createWriteStream(dest)
  out.on('error', callback)
  out.write(sizeBuf)
  return out.write(headerBuf, function () {
    return writeFileListToStream(dest, filesystem, out, files, metadata, callback)
  })
github electron / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function(dest, filesystem, files, cb) {
  var headerPickle = pickle.createEmpty();
  headerPickle.writeString(JSON.stringify(filesystem.header));
  var headerBuf = headerPickle.toBuffer();

  var sizePickle = pickle.createEmpty();
  sizePickle.writeUInt32(headerBuf.length);
  var sizeBuf = sizePickle.toBuffer();

  var out = fs.createWriteStream(dest);
  out.write(sizeBuf);
  out.write(headerBuf, writeFileListToStream.bind(this, dest, filesystem, out, files, cb));
};
github electron / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function(dest, filesystem, files, cb) {
  var headerPickle = pickle.createEmpty();
  headerPickle.writeString(JSON.stringify(filesystem.header));
  var headerBuf = headerPickle.toBuffer();

  var sizePickle = pickle.createEmpty();
  sizePickle.writeUInt32(headerBuf.length);
  var sizeBuf = sizePickle.toBuffer();

  var out = fs.createWriteStream(dest);
  out.write(sizeBuf);
  out.write(headerBuf, writeFileListToStream.bind(this, dest, filesystem, out, files, cb));
};
github electron-userland / electron-builder / packages / app-builder-lib / src / asar / asarUtil.ts View on Github external
return new Promise((resolve, reject) => {
      const headerPickle = pickle.createEmpty()
      headerPickle.writeString(JSON.stringify(this.fs.header))
      const headerBuf = headerPickle.toBuffer()

      const sizePickle = pickle.createEmpty()
      sizePickle.writeUInt32(headerBuf.length)

      const sizeBuf = sizePickle.toBuffer()
      const writeStream = createWriteStream(this.outFile)
      writeStream.on("error", reject)
      writeStream.on("close", resolve)
      writeStream.write(sizeBuf)

      let fileSetIndex = 0

      let files = fileSets[0].files
      let metadata = fileSets[0].metadata
github electron / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = async function (dest, filesystem, files, metadata) {
  const headerPickle = pickle.createEmpty()
  headerPickle.writeString(JSON.stringify(filesystem.header))
  const headerBuf = headerPickle.toBuffer()

  const sizePickle = pickle.createEmpty()
  sizePickle.writeUInt32(headerBuf.length)
  const sizeBuf = sizePickle.toBuffer()

  const out = fs.createWriteStream(dest)
  await new Promise((resolve, reject) => {
    out.on('error', reject)
    out.write(sizeBuf)
    return out.write(headerBuf, () => resolve())
  })
  return writeFileListToStream(dest, filesystem, out, files, metadata)
}
github cellardoor42 / whatever / node_modules / electron-packager / node_modules / asar / lib / disk.js View on Github external
module.exports.writeFilesystem = function (dest, filesystem, files, metadata, callback) {
  let sizeBuf
  let headerBuf
  try {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(filesystem.header))
    headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    sizeBuf = sizePickle.toBuffer()
  } catch (error) {
    return callback(error)
  }

  const out = fs.createWriteStream(dest)
  out.on('error', callback)
  out.write(sizeBuf)
  return out.write(headerBuf, function () {
    return writeFileListToStream(dest, filesystem, out, files, metadata, callback)
  })
github electron-userland / electron-builder / src / asarUtil.ts View on Github external
private writeAsarFile(): Promise {
    const headerPickle = pickle.createEmpty()
    headerPickle.writeString(JSON.stringify(this.fs.header))
    const headerBuf = headerPickle.toBuffer()

    const sizePickle = pickle.createEmpty()
    sizePickle.writeUInt32(headerBuf.length)
    const sizeBuf = sizePickle.toBuffer()

    const writeStream = createWriteStream(this.outFile)
    return new BluebirdPromise((resolve, reject) => {
      writeStream.on("error", reject)
      writeStream.once("finish", resolve)
      writeStream.write(sizeBuf)

      let w: (list: Array, index: number) => void
      w = (list: Array, index: number) => {
        if (list.length === index) {

chromium-pickle-js

Binary value packing and unpacking

MIT
Latest version published 8 years ago

Package Health Score

53 / 100
Full package analysis