remix-url-resolver
Solidity import url resolver engine
Last updated 5 months ago by yann300 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install remix-url-resolver 
SYNC missed versions from official npm registry.

Remix URL resolver engine

resolve(url, urlHandler)

Returns json object with exact same path as import statement.

Output

{
	content: 'pragma solidity ^0.5.0;\nimport "./mortal.sol";\n\ncontract Greeter is Mortal {\n    /* Define variable greeting of the type string */\n    string greeting;\n\n    /* This runs when the contract is executed */\n    constructor(string memory _greeting) public {\n        greeting = _greeting;\n    }\n\n    /* Main function */\n    function greet() public view returns (string memory) {\n        return greeting;\n    }\n}\n',
	cleanURL: '../greeter.sol',
	type: 'local'
}

Usage

resolve(url, urlHandler) function should be called from within handleImportCb function of solc.compile(input, handleImportCb).

import { RemixURLResolver } from 'remix-url-resolver'

const urlResolver = new RemixURLResolver()
const fileName: string = '../greeter.sol'
urlResolver.resolve(fileName, urlHandler)
	.then((sources: object) => {
		console.log(sources)
	})
	.catch((e: Error) => {
		throw e
	})

References

Current Tags

  • 0.0.14                                ...           Dev2742 (7 months ago)
  • 0.0.16                                ...           latest (5 months ago)

16 Versions

  • 0.0.16                                ...           5 months ago
  • 0.0.15                                ...           7 months ago
  • 0.0.14                                ...           7 months ago
  • 0.0.13                                ...           7 months ago
  • 0.0.12                                ...           9 months ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (4)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |