GithubHelp home page GithubHelp logo

kryndex / js-ipfsd-ctl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ipfs/js-ipfsd-ctl

0.0 2.0 0.0 181 KB

Control an IPFS daemon using Node.js

License: MIT License

JavaScript 99.65% Shell 0.35%

js-ipfsd-ctl's Introduction

ipfsd-ctl

standard-readme compliant Coverage Status Travis CI Circle CI Appveyor CI Dependency Status js-standard-style

Control an ipfs node daemon using Node.js

Table of Contents

Install

Install:

npm install --save ipfsd-ctl

Usage

IPFS daemons are already easy to start and stop, but this module is here to do it from JavaScript itself.

// Start a disposable node, and get access to the api
// print the node id, and kill the temporary daemon

// IPFS_PATH will point to /tmp/ipfs_***** and will be
// cleaned up when the process exits.

var ipfsd = require('ipfsd-ctl')

ipfsd.disposableApi(function (err, ipfs) {
  ipfs.id(function (err, id) {
    console.log(id)
    process.exit()
  })
})

If you need want to use an existing ipfs installation you can set $IPFS_EXEC=/path/to/ipfs to ensure it uses that.

For more details see https://ipfs.github.io/js-ipfsd-ctl/.

Packaging

ipfsd-ctl can be packaged in Electron applications, but the ipfs binary has to be excluded from asar (Electron Archives), read more about unpack files from asar. ipfsd-ctl will try to detect if used from within an app.asar archive and tries to resolve ipfs from app.asar.unpacked. The ipfs binary is part of the go-ipfs-dep module.

electron-packager ./ --asar.unpackDir=node_modules/go-ipfs-dep

See electron asar example

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT

js-ipfsd-ctl's People

Contributors

daviddias avatar jbenet avatar dignifiedquire avatar krl avatar greenkeeperio-bot avatar haadcode avatar bcomnes avatar richardschneider avatar hackergrrl avatar fraubienenstich avatar ralphtheninja avatar edsilv avatar dryajov avatar harlantwood avatar richardlitt avatar scott113341 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.