{"_id":"solc-import","_rev":"2-8471ff6dcbc6324b32f4e47aa69d31f1","name":"solc-import","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"solc-import","version":"0.0.1","description":"solc import","main":"src/index.js","scripts":{"lint":"eslint src","test":"mocha test/**.js -t 30s","coverage":"nyc --reporter=html --reporter=text mocha test/**.js -t 30s","report-coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","release":"rm -rf package-lock.json && npm version minor && npm publish","patch":"rm -rf package-lock.json && npm version patch && npm publish"},"repository":{"type":"git","url":"git+https://github.com/alincode/solc-import.git"},"keywords":["ethereum","compiler","browser","solcjs"],"author":{"name":"alincode","email":"alincode@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/alincode/solc-import/issues"},"homepage":"https://github.com/alincode/solc-import#readme","devDependencies":{"chai":"^4.2.0","codecov":"^3.1.0","cross-fetch":"^3.0.0","eslint":"^5.12.0","eslint-plugin-mocha":"^5.2.1","fake-indexeddb":"^2.0.4","mocha":"^5.2.0","mock-browser":"^0.92.14","nyc":"^13.1.0"},"gitHead":"00842531a9671c625e9b739c8bfcc787ffa4a7e9","_id":"solc-import@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.6.0","_npmUser":{"name":"alincode","email":"alincode@gmail.com"},"dist":{"integrity":"sha512-1P4abHPu7UDfQHljxedqqIVp+PE15V1RHUoZs4h8iYRNIkPle0SHk5L1KPxaakNuUq25g0h8Jy1EafLHxug7og==","shasum":"66876ff1f5d854abfebf2c19d6e64b6b93a34ca3","tarball":"https://registry.npmjs.org/solc-import/-/solc-import-0.0.1.tgz","fileCount":15,"unpackedSize":14019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPzgXCRA9TVsSAnZWagAAfBYP/iDKRZFPdFZ5A2iwvWX3\nFe1i2aWxqWmxJt4H6E3N7ZfLD3977Gj/ZpDcHJxm0ei63bcGXfuXnJDceUP6\nzjENuD8i2HqQSXyPZXs+qtnFG7kEdkK3JOpk1OUGlJi30I0/+FyFVultRibr\nkiaWqvkzcqiuo23v8dMeMF9dI7/AbbatiwVxJCVq7gLir7V4Z13wZW6Cw7Ne\nb7lJpa8fHXPzXF/KroOYt0mjRPTZ+1lGhZK5C9UC5wy9sh+KYhLTJe5J7eO+\nyzY6AA160/4OI8uxXSgCgnF09nxrspqB160xAyImuh6vGCcug+o8d+ftGsA+\nVZQ64x45N/EDQ58Jq8UVKZ/ThSr+yNgiLmsF4ii8gMKD7jvicVvWSnrSyjkB\nDw8WYCMYgVarzQp2SW1KOj+ZlyJbA7OJHpyTPNRdEzYiS1AR3XG3bZ+J6Nl8\nCA+GEijO4lCynqmS1leCQDoSI4uHS6glCnWSqC9CDg+Ih3DbUg04DIpVlNM9\nKB1IQDRV0sGHcLnsOXoXApHsEKIiopawA8eZPQqRseA8lhzHG7AxqPz62NVT\nx9VjryOnP6/BDJ5ETI1ZII20rh5nUToEs5aeehw2R+eClDnjdNVQAC/tDPBZ\nZVbDwujg7tZfKGafG8c7Yvtl4Og9S6V/aMJQjp9QatoBojdcuor+74la6vm+\naPo4\r\n=ineM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICG3cMZSpFlaz9kBx1Te07B5rYHb4vG3igH3umNbqGGAAiABgjYmEgg0EzkGTnTDPEtCxbqqvt67TL4zLxWASMDZPA=="}]},"maintainers":[{"name":"alincode","email":"alincode@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solc-import_0.0.1_1547646998266_0.6864171969560338"},"_hasShrinkwrap":false},"0.0.2":{"name":"solc-import","version":"0.0.2","description":"solc import","main":"src/index.js","scripts":{"lint":"eslint src","test":"mocha --require test/bootstrap test/**.js -t 30s","coverage":"nyc --reporter=html --reporter=text mocha --require test/bootstrap test/**.js -t 30s","report-coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","release":"rm -rf package-lock.json && npm version minor && npm publish","patch":"rm -rf package-lock.json && npm version patch && npm publish"},"repository":{"type":"git","url":"git+https://github.com/alincode/solc-import.git"},"keywords":["ethereum","compiler","browser","solcjs"],"author":{"name":"alincode","email":"alincode@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/alincode/solc-import/issues"},"homepage":"https://github.com/alincode/solc-import#readme","devDependencies":{"chai":"^4.2.0","codecov":"^3.1.0","eslint":"^5.12.0","eslint-plugin-mocha":"^5.2.1","mocha":"^5.2.0","nyc":"^13.1.0","solcjs-mock":"0.0.1"},"gitHead":"3e48a550f7c19af9578902a68c96fac498533663","_id":"solc-import@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.6.0","_npmUser":{"name":"alincode","email":"alincode@gmail.com"},"dist":{"integrity":"sha512-NQMUiz2c1xm62Q1VhgTGa2DUQWr6bIpPIJxDhg77YPfCyrq4GO/o1BP0brp9gTpNzjYODG9I2Wh8vB8eJxFjXA==","shasum":"67bcc8be970d999fc8d92e076d1069c8c732d681","tarball":"https://registry.npmjs.org/solc-import/-/solc-import-0.0.2.tgz","fileCount":17,"unpackedSize":15404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUda0CRA9TVsSAnZWagAA+OcP/Rg/CG9aVJ7NKUlnEdTC\nY0qDD5W7NIrRU0qzIP6ezf9gKY4H/QCd8TxMnHK12qUnCU+DGSBwQGzWV/sj\nRuTMZfeiWrI41gY4ztEfgFnGGbZrE5HOEDhGH+hXryv/YVROwyDp7HtwhBpu\nrFm2mIAsMDilrDflUGIniU+BdyOzmPURqCAQc28P3ATW1++L5UDu4Xs1jpb1\nNiBW+xh3C9Imh0WqGO/YEJRQCWUCq9IApcBheAAc7S+hAK8j1q/C7QbFSjx0\nD8S5IsTMflDTB72iCtiK3l/kjcJowUgihJmZGVT2uCX1PUOet0h0o7GNKevT\nQrO5KCZ4eNsQOqBYYyOX3yov1JfuCk474UivLAzoIaBIW/5HQWSzY2X3J8+T\nAsVbQD75A280s1SP3LjS8Hf6ssee7B12FQ7eM4O/zUcUDl4pOvuWz1omAnRV\nU6oiP5iwH1ohG+fWh/U48Fwn0Tmxh4mii/7V1T+FqN91Mpy3XmZJrfLncUTn\n80jXF1Z2msIie57201+MqsQzLTtUy9/IQkcQXK0/DAF6xLOEB8ni/eIetRtQ\nS48wJTj6B6ur7ycTnDQI6CRLRzrIYq7S9+ENpkxT4NbWQ/AeR5ZfapGBNSNB\nLiTGTRa5SzzLpAJ7prRCTrYt2G5Fa376yvr6GgAPGneQMV4zCXJPG5mlsW1D\nS9u5\r\n=uhd5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDg06+cz8byl0Y6k1/xDwL9kw9K/qs00x6li1gT3HN37AIhAMcqn2Srv8lmFrngs7JXtYST6DUkU+ayNKzbBYay2QXH"}]},"maintainers":[{"name":"alincode","email":"alincode@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solc-import_0.0.2_1548867252362_0.14065317867598437"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-16T13:56:38.266Z","0.0.1":"2019-01-16T13:56:38.439Z","modified":"2022-05-18T07:20:05.450Z","0.0.2":"2019-01-30T16:54:12.457Z"},"maintainers":[{"name":"alincode","email":"alincode@gmail.com"}],"description":"solc import","homepage":"https://github.com/alincode/solc-import#readme","keywords":["ethereum","compiler","browser","solcjs"],"repository":{"type":"git","url":"git+https://github.com/alincode/solc-import.git"},"author":{"name":"alincode","email":"alincode@gmail.com"},"bugs":{"url":"https://github.com/alincode/solc-import/issues"},"license":"MIT","readme":"# Solc import\n\n![Travis](https://img.shields.io/travis/alincode/solc-import.svg)\n[![codecov](https://codecov.io/gh/alincode/solc-import/branch/master/graph/badge.svg)](https://codecov.io/gh/alincode/solc-import)![npm downloads](https://img.shields.io/npm/dt/solc-import.svg)\n[![Dependency Status](https://img.shields.io/david/alincode/solc-import.svg?style=flat)](https://david-dm.org/alincode/solc-import)\n\n### Install\n\n```sh\nnpm install solc-import\n```\n\n### usage\n\n* combineSource\n\n```js\nlet myDB = new Map();\nmyDB.set('lib.sol', 'library L { function f() internal returns (uint) { return 7; } }');\n\nconst getImportContent = async function (path) {\n  return myDB.get(path);\n};\n\nconst sourceCodeIncludeImport = `\nimport 'lib.sol';\n\ncontract Casino {\n    using SafeMath for uint256;\n    function example(uint256 _value) {\n        uint number = msg.value.add(_value);\n    }\n}`;\n\nlet sources = await solcImport.combineSource(sourceCodeIncludeImport, getImportContent);\n// [{ path: 'lib.sol', content: '....'}]\n\n```\n\n* getImports\n\n```js\nconst sourceCode = `\nimport 'https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol';\n\ncontract Casino {\n    using SafeMath for uint256;\n    function example(uint256 _value) {\n        uint number = msg.value.add(_value);\n    }\n}`;\n\nlet imports = solcImport.getImports(sourceCode);\n// ['https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol']\n```\n\n* getReadCallback\n\n```js\nconst sourceCode = `\npragma solidity >0.4.99 <0.6.0;\n\nimport \"lib.sol\";\n\nlibrary OldLibrary {\n  function someFunction(uint8 a) public returns(bool);\n}\n\ncontract NewContract {\n  function f(uint8 a) public returns (bool) {\n      return OldLibrary.someFunction(a);\n  }\n}`;\n\nlet libContent = 'library L { function f() internal returns (uint) { return 7; } }';\n\nlet myDB = new Map();\nmyDB.set('lib.sol', libContent);\n\nconst getImportContent = async function (path) {\n  return myDB.get(path);\n};\n\nlet readCallback = await solcImport.getReadCallback(sourceCode, getImportContent);  // function\n```\n\n* isExistImport\n\n```js\nconst sourceCode = `\npragma solidity >0.4.99 <0.6.0;\n\nimport \"lib.sol\";\n\nlibrary OldLibrary {\n  function someFunction(uint8 a) public returns(bool);\n}\n\ncontract NewContract {\n  function f(uint8 a) public returns (bool) {\n      return OldLibrary.someFunction(a);\n  }\n}`;\nlet isExist = solcImport.isExistImport(sourceCode); // true\n```\n\n\n## License\nMIT © [alincode](https://github.com/alincode/solc-import)\n\n","readmeFilename":"README.md"}