{"analyzedAt":"2022-07-11T10:13:36.868Z","collected":{"metadata":{"name":"@pinata/ipfs-gateway-tools","scope":"pinata","version":"1.3.0","description":"Toolkit for working with IPFS Gateways and CIDs","keywords":["ipfs","gateway","pinata"],"date":"2022-04-12T18:45:44.175Z","author":{"name":"Matt Ober","email":"matt@pinata.cloud","url":"https://github.com/obo20","username":"mattober"},"publisher":{"username":"mattober","email":"matt@pinata.cloud"},"maintainers":[{"username":"mattober","email":"matt@pinata.cloud"},{"username":"polluterofminds","email":"justin@polluterofminds.com"}],"repository":{"type":"git","url":"git+https://github.com/PinataCloud/ipfs-gateway-tools.git"},"links":{"npm":"https://www.npmjs.com/package/%40pinata%2Fipfs-gateway-tools","homepage":"https://github.com/PinataCloud/ipfs-gateway-tools","repository":"https://github.com/PinataCloud/ipfs-gateway-tools","bugs":"https://github.com/PinataCloud/ipfs-gateway-tools/issues"},"license":"MIT","dependencies":{"is-ipfs":"^5.0.0"},"devDependencies":{"@babel/cli":"^7.13.16","@babel/core":"^7.13.16","@babel/plugin-proposal-class-properties":"^7.13.0","@babel/polyfill":"^7.12.1","@babel/preset-env":"^7.13.15","auto-changelog":"^2.4.0","babel-eslint":"^10.1.0","babel-loader":"^8.2.2","babel-preset-minify":"^0.5.0","clean-webpack-plugin":"*","css-loader":"^5.2.4","eslint":"^7.24.0","file-loader":"^6.2.0","husky":"^4.3.8","jest":"^26.6.3","prettier":"^2.6.2","prettier-webpack-plugin":"^1.2.0","style-loader":"^2.0.0","terser-webpack-plugin":"^5.1.1","url-loader":"^4.1.1","webpack":"^5.35.0","webpack-cli":"^4.6.0","webpack-dev-server":"4.0.0-beta.2","webpack-node-externals":"^3.0.0"},"releases":[{"from":"2022-06-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":0},{"from":"2022-04-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":2},{"from":"2022-01-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":3},{"from":"2021-07-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":3},{"from":"2020-07-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":12}],"hasTestScript":true,"readme":"# IPFS Gateway Tools\n\nIPFS Gateway Tools\n\n## Overview\n\nThis toolkit contains helper functions for working with IPFS gateway URLs and transforming them as desired.\n\nThis package comes with a distributions for the browser and for NodeJS. Take care to ensure you are importing or requiring in the right version.\n\n## Installation\n\n```\nnpm install --save @pinata/ipfs-gateway-tools\n```\n\n## Browser Setup\n\nTo require this in your project simply include the library at the top of your file like so:\n\n```javascript\nimport IPFSGatewayTools from \"@pinata/ipfs-gateway-tools/dist/browser\";\nconst gatewayTools = new IPFSGatewayTools();\n```\n\n## NodeJS Setup\n\n```javascript\nconst IPFSGatewayTools = require(\"@pinata/ipfs-gateway-tools/dist/node\");\nconst gatewayTools = new IPFSGatewayTools();\n```\n\n## Usage\n\nThe IPFS gateway toolkit currently contains the following functions:\n\n- [containsCID](#containsCID-anchor)\n- [convertToDesiredGateway](#convertToDesiredGateway-anchor)\n\n<a name=\"containsCID-anchor\"></a>\n\n### containsCID\n\n##### `ipfsGatewayTools.containsCID(url)`\n\n##### Params\n\n- `url` - A gateway url that should take one of the following forms:\n  - `ipfs://CID`\n  - `ipfs://ipfs/CID`\n  - `https://example-gateway.com/ipfs/CID`\n  - `https://example-gateway.com/ipfs/CID/exampleFile.json`\n  - `https://example-gateway.com/ipns/CID`\n\n#### Response\n\n```\n{\n    containsCid: (Boolean) - True if the url contains a CID,\n    cid: (string) - The CID that the url contains if \"containsCid\" is true\n}\n```\n\n<a name=\"convertToDesiredGateway-anchor\"></a>\n\n### convertToDesiredGateway\n\n##### `ipfsGatewayTools.convertToDesiredGateway(sourceUrl, desiredGatewayPrefix)`\n\n##### Params\n\n- `sourceUrl` - A gateway url that should take one of the following forms:\n  - `ipfs://CID`\n  - `ipfs://ipfs/CID`\n  - `https://example-gateway.com/ipfs/CID`\n  - `https://example-gateway.com/ipfs/CID/exampleFile.json`\n  - `https://example-gateway.com/ipns/CID`\n- `desiredGatewayPrefix` - The desired gateway you want to convert your source URL to. A few examples of this would be:\n  - `https://mygateway.mypinata.cloud`\n  - `https://ipfs.io`\n\n#### Response\n\nReturns a string that uses the desired source gateway prefix.\n\nExample code:\n\n```javascript\nconst sourceUrl =\n  \"https://exampleGateway.com/ipfs/bafybeifx7yeb55armcsxwwitkymga5xf53dxiarykms3ygqic223w5sk3m\";\nconst desiredGatewayPrefix = \"https://mygateway.mypinata.cloud\";\nconst convertedGatewayUrl = ipfsGatewayTools.convertToDesiredGateway(\n  sourceUrl,\n  desiredGatewayPrefix\n);\n\n//In the example above, the resulting value for convertedGatewayUrl would be: https://mygateway.mypinata.cloud/ipfs/bafybeifx7yeb55armcsxwwitkymga5xf53dxiarykms3ygqic223w5sk3m\n```\n\n## Questions? Issues? Suggestions?\n\nFeel free to file a github issue or email us at team@pinata.cloud\n\nWe'd love to hear from you!"},"npm":{"downloads":[{"from":"2022-07-10T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":98},{"from":"2022-07-04T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":2905},{"from":"2022-06-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":10541},{"from":"2022-04-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":33600},{"from":"2022-01-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":46114},{"from":"2021-07-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":59021}],"starsCount":0},"github":{"starsCount":43,"forksCount":15,"subscribersCount":6,"issues":{"count":12,"openCount":3,"distribution":{"3600":2,"10800":0,"32400":0,"97200":0,"291600":0,"874800":1,"2624400":1,"7873200":5,"23619600":3,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"rommel-pinata","commitsCount":4},{"username":"polluterofminds","commitsCount":4},{"username":"obo20","commitsCount":1}],"commits":[{"from":"2022-07-04T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":0},{"from":"2022-06-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":1},{"from":"2022-04-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":1},{"from":"2022-01-12T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":6},{"from":"2021-07-11T00:00:00.000Z","to":"2022-07-11T00:00:00.000Z","count":8}]},"source":{"files":{"readmeSize":2815,"testsSize":2716,"hasNpmIgnore":true,"hasChangelog":true},"linters":["eslint","prettier"],"outdatedDependencies":{"is-ipfs":{"required":"^5.0.0","stable":"6.0.2","latest":"6.0.2"}}}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.6,"health":0.75,"branding":0},"popularity":{"communityInterest":67,"downloadsCount":11200,"downloadsAcceleration":71.03820395738204,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9166666666666667,"issuesDistribution":0.9}},"score":{"final":0.6388209547146657,"detail":{"quality":0.8379881258934065,"popularity":0.10704635731845656,"maintenance":0.9998808339576686}}}