How to use the ipfs/package.json.version function in ipfs

To help you get started, we’ve selected a few ipfs 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 ipfs / js-ipfsd-ctl / test / spawning.js View on Github external
return () => {
    const VERSION_STRING = type === 'js'
      ? `js-ipfs version: ${require('ipfs/package.json').version}`
      : 'ipfs version 0.4.13'

    describe('daemon spawning', () => {
      it('prints the version', function (done) {
        if (!isNode || type === 'proc') {
          this.skip()
        }
        df.version({ exec }, (err, version) => {
          expect(err).to.not.exist()
          expect(version).to.be.eql(VERSION_STRING)
          done()
        })
      })

      describe('spawn a bare node', function () {
        this.ipfsd = null
github ipfs / js-ipfsd-ctl / test / spawn-options.spec.js View on Github external
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { isNode } = require('ipfs-utils/src/env')
const hat = require('hat')
const IPFSFactory = require('../src')
const JSIPFS = require('ipfs')
const { repoExists } = require('./../src/utils/repo/nodejs')
const tests = [
  { type: 'go', bits: 1024 },
  { type: 'js', bits: 512 },
  { type: 'proc', exec: JSIPFS, bits: 512 }
]

const jsVersion = require('ipfs/package.json').version
const versions = {
  js: `js-ipfs version: ${jsVersion}`,
  go: `ipfs version ${require('go-ipfs-dep/package.json').version}`,
  proc: jsVersion
}

describe('Spawn options', function () {
  this.timeout(60 * 1000)

  tests.forEach((fOpts) => describe(`${fOpts.type}`, () => {
    const VERSION_STRING = versions[fOpts.type]
    let f

    before(() => {
      f = IPFSFactory.create(fOpts)
    })

ipfs

JavaScript implementation of the IPFS specification

Apache-2.0 OR MIT
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis