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

illuminate-support

v0.0.4

Published

Inspired by Laravel Framework

Downloads

384

Readme

illuminate-support

Inspired by Laravel Framework: Support Component.

Install

npm install illuminate-support

Component

Str

ctypeLower(str)

  • str:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'hello'
console.log(Str.ctypeLower(str1)) // output: true

const str2 = 'Hello'
console.log(Str.ctypeLower(str2)) // output: false

lcfirst(str)

  • str:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.lcfirst(str1)) // output: helloWorld

strncmp(str1, str2, length)

  • str1:
    • (required) The input string 1.
  • str2:
    • (required) The input string 2.
  • length:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
const str2 = 'HelloMars'
console.log(Str.strncmp(str1, str2, 5)) // output: 0

const str3 = 'HelloWorld'
const str4 = 'HiMars'
console.log(Str.strncmp(str1, str2, 5)) // output: -1

const str5 = 'HelloWorld'
const str6 = 'HalloMars'
console.log(Str.strncmp(str1, str2, 5)) // output: 1

ucwords(str, delimiter = '\s\t\r\n\f\v')

  • str:
    • (required) The input string.
  • delimiter:
    • (optional) The optional delimiters contains the word separator characters.
    • Default: '\s\t\r\n\f\v'.
import {Str} from 'illuminate-support'

const str1 = 'hello world'
console.log(Str.ucWords(str1)) // output: 'Hello World'

const str2 = 'hello_world'
console.log(Str.ucWords(str2, '_')) // output: 'Hello_World'

after(subject, search)

  • subject:
    • (required) The input string.
  • search:
    • (required) The search string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.after(str1, 'l')) // output: loWorld

const str2 = 'HelloWorld'
console.log(Str.after(str2, '')) // output: HelloWorld

const str3 = 'HelloWorld'
console.log(Str.after(str3, 'a')) // output: HelloWorld

afterLast(subject, search)

  • subject:
    • (required) The input string.
  • search:
    • (required) The search string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.afterLast(str1, 'l')) // output: d

const str2 = 'HelloWorld'
console.log(Str.afterLast(str2, '')) // output: HelloWorld

const str3 = 'HelloWorld'
console.log(Str.afterLast(str3, 'a')) // output: HelloWorld

before(subject, search)

  • subject:
    • (required) The input string.
  • search:
    • (required) The search string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.before(str1, 'l')) // output: He

const str2 = 'HelloWorld'
console.log(Str.before(str2, '')) // output: HelloWorld

const str3 = 'HelloWorld'
console.log(Str.before(str3, 'a')) // output: HelloWorld

beforeLast(subject, search)

  • subject:
    • (required) The input string.
  • search:
    • (required) The search string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.beforeLast(str1, 'l')) // output: HelloWor

const str2 = 'HelloWorld'
console.log(Str.beforeLast(str2, '')) // output: HelloWorld

const str3 = 'HelloWorld'
console.log(Str.beforeLast(str3, 'a')) // output: HelloWorld

between(subject, from, to)

  • subject:
    • (required) The input string.
  • from:
    • (required) The search from string.
  • to:
    • (required) The search to string.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.between(str1, 'l', 'l')) // output: loWor

const str2 = 'HelloWorld'
console.log(Str.between(str2, '', '')) // output: HelloWorld
console.log(Str.between(str2, '', 'l')) // output: HelloWorld
console.log(Str.between(str2, 'l', '')) // output: HelloWorld

camel(value)

  • value:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'hello world'
console.log(Str.camel(str1)) // output: 'helloWorld'

const str2 = 'hello_world'
console.log(Str.camel(str2)) // output: 'helloWorld'

const str3 = 'HelloWorld'
console.log(Str.camel(str3)) // output: 'helloWorld'

contains(haystack, needles)

  • value:
    • (required) The input string.
  • needles:
    • (required) The search string, or the array of search strings.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.containsA(str1, 'Hello')) // output: true

const str2 = 'HelloWorld'
console.log(Str.contains(str2, ['Hello', 'John'])) // output: true

const str3 = 'HelloWorld'
console.log(Str.contains(str3, ['Hi', 'John'])) // output: false

containsAll(haystack, needles)

  • value:
    • (required) The input string.
  • needles:
    • (required) The array of search strings.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.containsAll(str1, ['Hello', 'World'])) // output: true

const str2 = 'HelloWorld'
console.log(Str.containsAll(str2, ['Hello', 'John'])) // output: false

endsWith(haystack, needles)

  • value:
    • (required) The input string.
  • needles:
    • (required) The search string, or the array of search strings.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.endsWith(str1, 'World')) // output: true

const str2 = 'HelloWorld'
console.log(Str.endsWith(str2, ['John', 'World'])) // output: true

const str3 = 'HelloWorld'
console.log(Str.endsWith(str3, ['John', 'Mary'])) // output: false

snake(value)

  • value:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'hello world'
console.log(Str.snake(str1)) // output: 'hello_world'

const str2 = 'helloWorld'
console.log(Str.snake(str2)) // output: 'hello_world'

const str3 = 'HelloWorld'
console.log(Str.snake(str3)) // output: 'hello_world'

startsWith(haystack, needles)

  • value:
    • (required) The input string.
  • needles:
    • (required) The search string, or the array of search strings.
import {Str} from 'illuminate-support'

const str1 = 'HelloWorld'
console.log(Str.startsWith(str1, 'Hello')) // output: true

const str2 = 'HelloWorld'
console.log(Str.startsWith(str2, ['Hello', 'Hi'])) // output: true

const str3 = 'HelloWorld'
console.log(Str.startsWith(str3, ['Hi', 'Hallo'])) // output: false

studly(value)

  • value:
    • (required) The input string.
import {Str} from 'illuminate-support'

const str1 = 'hello world'
console.log(Str.studly(str1)) // output: 'HelloWorld'

const str2 = 'hello_world'
console.log(Str.studly(str2)) // output: 'HelloWorld'

const str3 = 'helloWorld'
console.log(Str.studly(str3)) // output: 'HelloWorld'

Manager

To support Builder (Manager) pattern.

import {Manager} from 'illuminate-support'

class ServerManager extends Manager {
}