index.js
function createTorrent (input, opts, cb) {
  if (typeof opts === 'function') [ opts, cb ] = [ cb, opts ]
  opts = opts ? Object.assign({}, opts) : {}

  _parseInput(input, opts, (err, files, singleFileTorrent) => {
    if (err) return cb(err)
    opts.singleFileTorrent = singleFileTorrent
    onFiles(files, opts, cb)
  })
}
function createTorrent (input, opts, cb) {
  if (typeof opts === 'function') [ opts, cb ] = [ cb, opts ]
  opts = opts ? Object.assign({}, opts) : {}

  _parseInput(input, opts, (err, files, singleFileTorrent) => {
    if (err) return cb(err)
    opts.singleFileTorrent = singleFileTorrent
    onFiles(files, opts, cb)
  })
}
function createTorrent ( input , opts , cb ) { if ( typeof opts === 'function' ) [ opts , cb ] = [ cb , opts ] opts = opts ? Object . assign ( { } , opts ) : { } _parseInput ( input , opts , ( err , files , singleFileTorrent ) => { if ( err ) return cb ( err ) opts . singleFileTorrent = singleFileTorrent onFiles ( files , opts , cb ) } ) }
Create a torrent.
@param  {string|File|FileList|Buffer|Stream|Array.<string|File|Buffer|Stream>} input
@param  {Object} opts
@param  {string=} opts.name
@param  {Date=} opts.creationDate
@param  {string=} opts.comment
@param  {string=} opts.createdBy
@param  {boolean|number=} opts.private
@param  {number=} opts.pieceLength
@param  {Array.<Array.<string>>=} opts.announceList
@param  {Array.<string>=} opts.urlList
@param  {function} cb
@return {Buffer} buffer of .torrent file data
Create a torrent .