# All files / src/client index.js

100% Statements 20/20
100% Branches 0/0
100% Functions 0/0
100% Lines 20/20

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    421x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    23x

    23x
    23x
    23x
    23x
    23x
    23x

    23x

     import { caller } from 'postmsg-rpc'
    import callbackify from 'callbackify'
    import createBlock from './block'
    import createConfig from './config'
    import createDag from './dag'
    import createDht from './dht'
    import createFiles from './files'
    import createKey from './key'
    import createObject from './object'
    import createPin from './pin'
    import createPubsub from './pubsub'
    import createSwarm from './swarm'

    export default (opts) => {
      const ipfs = {
        id: callbackify(caller('ipfs.id', opts)),
        version: callbackify(caller('ipfs.version', opts)),
        dns: callbackify.variadic(caller('ipfs.dns', opts)),
        block: createBlock(opts),
        config: createConfig(opts),
        dag: createDag(opts),
        dht: createDht(opts),
        files: createFiles(opts),
        key: createKey(opts),
        object: createObject(opts),
        pin: createPin(opts),
        pubsub: createPubsub(opts),
        swarm: createSwarm(opts),
        stop: callbackify(caller('ipfs.stop', opts))
      }

      // Aliases
      ipfs.add = ipfs.files.add
      ipfs.get = ipfs.files.get
      ipfs.cat = ipfs.files.cat
      ipfs.ls = ipfs.files.ls
      ipfs.lsReadableStream = ipfs.files.lsReadableStream
      ipfs.lsPullStream = ipfs.files.lsPullStream

      return ipfs
    }