solc-resolver
v0.2.3
Published
solc resolver
Downloads
306
Maintainers
Readme
Solc resolver
Install
npm install solc-resolver
Usage
- require
const ResolverEngine = require('solc-resolver').resolverEngine;
let resolverEngine = new ResolverEngine();
let resolveGithub = require('resolve-github');
resolverEngine.addResolver(resolveGithub);
let resolveHttp = require('resolve-http');
resolverEngine.addResolver(resolveHttp);
let resolveIPFS = require('resolve-ipfs');
resolverEngine.addResolver(resolveIPFS);
let resolveSwarm = require('resolve-swarm');
resolverEngine.addResolver(resolveSwarm);
const uri = 'https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol';
const content = await resolverEngine.require(uri);
const uri2 = 'http://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/master/contracts/math/SafeMath.sol';
const content = await resolverEngine.require(uri2);
const uri3 = 'https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/master/contracts/math/SafeMath.sol';
const content = await resolverEngine.require(uri3);
const uri4 = 'ipfs://QmTeW79w7QQ6Npa3b1d5tANreCDxF2iDaAPsDvW6KtLmfB/styles/jquery/jquery.min.js';
const content = await resolverEngine.require(uri4);
const uri5 = 'bzz:/photoalbum.eth/';
const content = await resolverEngine.require(uri5);
License
MIT © alincode