Skip to content

Commit

Permalink
Merge pull request libp2p#39 from diasdavid/fix/require
Browse files Browse the repository at this point in the history
fix: always use fs.readFileSync
  • Loading branch information
daviddias committed Apr 19, 2016
2 parents 7a3f9d0 + 851c8ee commit ac7c8a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"dignifiedquire <dignifiedquire@gmail.com>"
]
}
}
6 changes: 1 addition & 5 deletions src/identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ const Info = require('peer-info')
const Id = require('peer-id')
const multiaddr = require('multiaddr')

const isNode = !global.window

const identity = isNode
? fs.readFileSync(path.join(__dirname, 'identify.proto'))
: require('buffer!./identify.proto')
const identity = fs.readFileSync(path.join(__dirname, 'identify.proto'))

const pbStream = require('protocol-buffers-stream')(identity)

Expand Down

0 comments on commit ac7c8a1

Please sign in to comment.