npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

is-forwardslash

v1.0.0

Published

Checks given value is forwardslash - support char code number, hex, unicode or string value to be given.

Downloads

18

Readme

is-forwardslash npmjs.com The MIT License

Checks given value is forwardslash - support char code number, hex, unicode or string value to be given.

code climate standard code style travis build status coverage status dependency status

Install

npm i is-forwardslash --save

Usage

For more use-cases see the tests

const isForwardslash = require('is-forwardslash')

isForwardslash

Check value is strictly forwardslash or forwardslash-like.

  • [val] {String|Number} value to check
  • [opts] {Object} only opts.strict option, default false
  • returns {Boolean}

Example

const isForwardslash = require('is-forwardslash')

// returns true (default mode, opts.strict !== true)
console.log(isForwardslash(47, {strict: 123})) // => true
console.log(isForwardslash(47))                // => true
console.log(isForwardslash('47'))              // => true
console.log(isForwardslash('/'))              // => true
console.log(isForwardslash('\u002F'))          // => true
console.log(isForwardslash('\u002f'))          // => true
console.log(isForwardslash('\x2f'))            // => true
console.log(isForwardslash('/'))           // => true

// strict mode - need explicitly define `opts.strict: true`
console.log(isForwardslash(47, {strict: true}))        // => false
console.log(isForwardslash('47', {strict: true}))      // => false
console.log(isForwardslash('/', {strict: true}))      // => true
console.log(isForwardslash('\u002F', {strict: true}))  // => true
console.log(isForwardslash('\u002f', {strict: true}))  // => true
console.log(isForwardslash('\x2f', {strict: true}))    // => true

console.log(isForwardslash('/', {strict: 123}))    // => true
console.log(isForwardslash('/', {strict: true}))   // => false
console.log(isForwardslash(['foo', 'bar']))            // => false
console.log(isForwardslash({a: 'b'}))                  // => false
console.log(isForwardslash())                          // => false

Related

  • is-async-function: Check that given function is async (callback) function or not. Trying to guess that based on check if callback, cb, done or next exists as function argument name.
  • is-backslash: Checks given value is backslash - support char code number, hex, unicode or string value to be given.
  • is-child-process: Checks whether a value is child process result, which in case is more specific Node.js EventEmitter.
  • is-emitter: Check that given value is EventEmitter, not so strict as is-node-emitter.
  • is-empty-function: Check that given string, function or arrow function have empty body, using parse-function.
  • is-hexcolor: Check that given value is valid hex color, using hex-color-regex - the best regex for matching hex color values
  • is-installed: Checks that given package is installed on the system - globally or locally.
  • is-kindof: Check type of given javascript value. Support promises, generators, streams, and native types.
  • is-missing: Check that given name or user/repo exists in npm registry or in github as user repository.
  • is-node-emitter: Strictly checks that given value is nodejs EventEmitter. It's easy, because his API is in frozen state.
  • is-node-stream: Strictly and correctly checks if value is a nodejs stream.
  • is-real-object: Returns true if a value is any type of object, but not an array. Browserify-ready.
  • is-request-stream: Check that given value is request stream
  • is-singular: Return true if given word is in singular form like apple, car, test and false otherwise, never throws.
  • is-sync-function: Opposite of is-async-function. Check that given function is synchronous.
  • is-typeof-error: Check that given value is any type of error and instanceof Error

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github