Socket
Socket
Sign inDemoInstall

is-ipfs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-ipfs

A set of utilities to help identify IPFS resources


Version published
Weekly downloads
32K
increased by0.93%
Maintainers
1
Weekly downloads
 
Created
Source

is-ipfs

build status js-standard-style

A set of utilities to help identify IPFS resources.

Install

npm i --save is-ipfs

Usage

const isIPFS = require('is-ipfs')

isIPFS.multihash('QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o') // true
isIPFS.multihash('noop') // false

isIPFS.url('http://ipfs.io/ipfs/QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o') // true
isIPFS.url('https://github.com/ipfs/js-ipfs/blob/master/README.md') // false
isIPFS.url('https://google.com') // false

API

isIPFS.multihash(hash)

Returns true if the provided string is a valid multihash or false otherwise.

isIPFS.url(hash)

Returns true if the provided string is a valid IPFS url or false otherwise.

Note: the regex used for this check is also exported as isIPFS.urlPattern

License

MIT

Keywords

FAQs

Package last updated on 31 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc