This lets you poll locations from IPFS very easily. This is used by ipfs-stats to manage hundreds of location lookups. It looks up locations sequentially to improve the performance and avoid too many requests at once.
Install
In Node.js through npm
$ npm install --save ipfs-locations
Browser: Browserify, Webpack, other bundlers
The code published to npm that gets loaded on require is in fact an ES5 transpiled version with the right shims added. This means that you can require it and use with your favorite bundler without having to adjust asset management process.
constLocationsPoller=require('ipfs-locations')
In the Browser through <script> tag
Loading this module through a script tag will make the IpfsLocations obj available in the global namespace.
<script src="https://unpkg.com/ipfs-locations/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/ipfs-locations/dist/index.js"></script>
请发表评论