Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Javascript implementation for truly checking if the provided input is a valid URI, Based on RFC 3986.
Javascript implementation for truly checking if the provided input is a valid URI, Based on RFC 3986.
$ npm install isuri
var isUri = require('isuri');
isUri.isValid('http://example.com'); // returns true
isUri.isValid('Bananas in pajamas are coming down the stairs'); // returns false
Checks if the value provided is a valid URI and returns true if so, returns false otherwise.
Returns the regular expression used for validating URIs.
Creates a new regular expression for validating URIs which accepts the following parameters:
options
- optional settings:
scheme
- Specifies one or more acceptable Schemes, should only include the scheme name. Can be an Array or String (strings are automatically escaped for use in a Regular Expression).var isUri = require('isuri');
var httpRegex = isUri.createUriRegex({ scheme: [ /https?/ ] });
httpRegex.test('http://example.com'); // returns true
httpRegex.test('https://example.com'); // returns true
httpRegex.test('ftp://example.com'); // returns false
httpRegex.test('Bananas in pajamas are coming down the stairs'); // returns false
> Benchmarking complex-ipv4.js
Testing URI "http://asdf:qw%20er@127.0.0.1:8000?asdf=12345&asda=fc%2F#bacon"
1 test completed.
isUri#test(uri) x 6,229,053 ops/sec ±0.83% (183 runs sampled)
> Benchmarking complex-ipv6.js
Testing URI "http://asdf:qw%20er@[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:8000?asdf=12345&asda=fc%2F#bacon"
1 test completed.
isUri#test(uri) x 5,197,138 ops/sec ±0.74% (182 runs sampled)
> Benchmarking complex-ipvFuture.js
Testing URI "http://asdf:qw%20er@[v1.09azAZ-._~!$&'()*+,;=:]:8000?asdf=12345&asda=fc%2F#bacon"
1 test completed.
isUri#test(uri) x 4,418,023 ops/sec ±0.63% (183 runs sampled)
> Benchmarking complex-uri.js
Testing URI "http://asdf:qw%20er@localhost:8000?asdf=12345&asda=fc%2F#bacon"
1 test completed.
isUri#test(uri) x 6,113,035 ops/sec ±0.68% (184 runs sampled)
> Benchmarking simple-uri.js
Testing URI "mailto:John.Doe@example.com"
1 test completed.
isUri#test(uri) x 10,444,735 ops/sec ±0.73% (183 runs sampled)
FAQs
Javascript implementation for truly checking if the provided input is a valid URI, Based on RFC 3986.
The npm package isuri receives a total of 292 weekly downloads. As such, isuri popularity was classified as not popular.
We found that isuri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.