Sha256: bd3b87e0dff150303338e8a7d39e785377e0307480e314575e5ce83783c48b1d

Contents?: true

Size: 557 Bytes

Versions: 27

Compression:

Stored size: 557 Bytes

Contents

module.exports = loadCAFile

var fs = require('fs')

function loadCAFile(cafilePath, cb) {
  if (!cafilePath)
    return process.nextTick(cb)

  fs.readFile(cafilePath, 'utf8', afterCARead.bind(this))

  function afterCARead(er, cadata) {
    if (er)
      return cb(er)

    var delim = '-----END CERTIFICATE-----'
    var output

    output = cadata
      .split(delim)
      .filter(function(xs) {
        return !!xs.trim()
      })
      .map(function(xs) {
        return xs.trimLeft() + delim
      })

    this.set('ca', output)
    cb(null)
  }

}

Version data entries

27 entries across 20 versions & 3 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/lib/load-cafile.js
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/lib/load-cafile.js
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-sass/node_modules/node-sass/node_modules/npmconf/lib/load-cafile.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/lib/load-cafile.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/lib/load-cafile.js