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

psycript

v0.2.1

Published

> `Python` style functions.

Downloads

6

Readme

Psycript

Python style functions.

Install

npm install psycript

Usage

import psycript from "psycript";

console.log(psycript);

String

Transform the string to different Cases.

Set A Value

const value = psycript.str("I'm Twisted !!!");

Transform The Value


  • Lower: value.lower;
  • Upper: value.upper;
  • Title: value.title;
  • Pascal: value.pascal;
  • Camel: value.camel;
  • Slug: value.slug;
  • Snake: value.snake;
  • Cut: (Integer) value.cut(size);

Dict

Python style Dict = Object(JSON).

const kwargs = {
  ID: "graphql_id",
  name: "johndoe",
};
const dict = Dict(kwargs);

Class Methods


  • Keys: dict.keys();
  • Values: dict.values();
  • Items: dict.items();
  • Dict: dict.dict();
  • forDict: dict.forDict((key, value) => { console.log(key, value); });
  • forList: dict.forList((item) => { console.log(item); });

Fields


Core

  • Integer: psycript.fields.int(text);
  • Decimal: psycript.fields.decimal(text);
  • Letters: psycript.fields.letters(text);
  • Alphanum: psycript.fields.alphanum(text);
  • Slug: psycript.fields.slug(text);

User Related

  • Zipcode: psycript.fields.zipcode(text);
  • Username: psycript.fields.username(text);
  • Email: psycript.fields.email(text);
  • Phone: psycript.fields.phone(text);

Tags

  • ,Tags: psycript.fields.tags(text); comma tags.
  • #Tags: psycript.fields.hashtags(text);
  • @Tags: psycript.fields.attags(text);

"IS" Value Check

Check if the value is of certain Type.

Set A Value

const value = "AnyValue";

Check IF The Value (Is...)


  • Function: psycript.is.function(value);
  • Dict: psycript.is.dict(value);
  • Str: psycript.is.str(value);
  • Number: psycript.is.number(value);
  • List: psycript.is.list(value);
  • Null: psycript.is.null(value);
  • Undefined: psycript.is.undefined(value);
  • None: (Null or Undefined) psycript.is.none(value);
  • Bool: psycript.is.bool(value);
  • Date: psycript.is.date(value);
  • Regex: psycript.is.regex(value);

Storage

Manage Browser's Storage

Storage Session

  • set: psycript.session.set(key)
  • get: psycript.session.get(key)
  • del: psycript.session.del(key)
  • clear: psycript.session.clear(key)

Storage Local

  • set: psycript.local.set(key)
  • get: psycript.local.get(key)
  • del: psycript.local.del(key)
  • clear: psycript.local.clear(key)

Random

Create Random Values.

Create A Value

psycript.random.lowercase(10);

Create A Random String


  • LowerCase: psycript.random.lowercase(size)
  • UpperCase: psycript.random.uppercase(size)
  • Letters: psycript.random.letters(size)
  • Alphanum: psycript.random.alphanum(size)
  • Digits: psycript.random.digits(size)
  • Hexdigits: psycript.random.hexdigits(size)
  • All: psycript.random.all(size)

Lorem

Create Random Lorem Strings.

Create A Value

psycript.random.word(10);

Create A Sentence Random Lorem


  • Word: psycript.lorem.word(size)
  • W: psycript.lorem.w(size)

Create A Word Random Lorem


  • Sentence: psycript.lorem.sentence(size)
  • S: psycript.lorem.sentence(size)