Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alincode/solc-resolver
https://github.com/alincode/solc-resolver
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alincode/solc-resolver
- Owner: alincode
- License: mit
- Created: 2019-01-16T14:05:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-07T15:22:55.000Z (over 5 years ago)
- Last Synced: 2024-12-15T14:09:22.424Z (20 days ago)
- Language: JavaScript
- Size: 94.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Solc resolver
![Travis](https://img.shields.io/travis/alincode/solc-resolver.svg)
[![codecov](https://codecov.io/gh/alincode/solc-resolver/branch/master/graph/badge.svg)](https://codecov.io/gh/alincode/solc-resolver)![npm downloads](https://img.shields.io/npm/dt/solc-resolver.svg)
[![Dependency Status](https://img.shields.io/david/alincode/solc-resolver.svg?style=flat)](https://david-dm.org/alincode/solc-resolver)### Install
```sh
npm install solc-resolver
```### Usage
* require
```js
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](https://github.com/alincode/solc-resolver)