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

washswat-engine

v0.9.1

Published

Washswat utility engine.

Downloads

160

Readme

| api | description | |--------------------------|--------------------------| | getUidFromAuthentication | WashswatAuthtication API | | getAuthenticationFromUid | WashswatAuthtication API | |extractJwtWithoutAuthentication| Extract payload without actual authentication |

cache: node-cache and redis based cache wrapper

| api | description | |--------------------------|------------------------------------------------------------------------------------------------------------| |initRedis | Initialize cache to utilize redis. When cache uses without calling this init, it will use own memory cache. | |set | set cache. | |get | get cache |

config: washswat config wrapper, based on platform-config and mongodb based

| api | description | |---------------------------|------------------------------------------------------| | configure | Washswat platform configuration. | | getFullPlatformConfigData | getting full platform config data. | | getAppConfig| get application configuration data from package.json | |getGlobalGatewayUrl | get just gateway url from platform config data | |getPlatformConfig| get first platform config data. | |readPlatformConfig | read platform config data from mongodb | |setHeader|set http/https header | |clearExtraHeader| clear local header storage for new request | |addHeader | add new header. Probably for testing/debugging/information purpose |

httpclient: axios based, cache-able REST client tool

| api | description | |---------------------------|------------------------------------------------------| | call | call axios based rest call with retry, cache functionality |

logger: logger without using log4js

| api | description | |--------------------------|-----------------------------| | FelixLogger.constructor | initialize logger | | FelixLogger.setLevel | set log level | | FelixLogger.setPrompt | set log prompt | | FelixLogger.setTimestamp | set log timestamp | | FelixLogger.print | print formatted log message | | FelixLogger.debug | print debug log | | FelixLogger.info | print info log | | FelixLogger.warn | print warn log | | FelixLogger.error | print error log | | FelixLogger.fatal | print fatal log | |findMyLogger| find logger by name | |getLogger| get logger by name | |setLogLevel| set log level by name |

mongoClient: mongodb based, cache-able mongodb client tool

Note: *2 version of apis are for supporting Typescript.

| api | description | |------------|-------------------------------------| | init/init2 | initialize with mongo configuration | |count | count query | |findOne/findOne2 | find one query with cache support | |deleteOne/deleteOne2 | delete one query | |deleteMany/deleteMany2 | delete many query | |updateOne/updateOne2 | update one quey | |insertOne/intertOne2 | insert one query | |insertMany/insertMany2 | inset many query | |find/find2 | find query with cache support |

mysql: mysql based, cache-able mysql client tool

| api | description | |------------|-------------------------------------| | init | initialize with mysql configuration | |query | query with cache support |

timer: timer utility for process duration tracking

| api | description | |-------------------|-----------------------------------| | Timer.constructor | initialize timer with information | | Timer.time | record lap time with information | | Timer.toString | get timing information as string | | Timer.toJSON | get timing information as JSON |

util2: some useful utilities, one with JSON.stringify without circular reference problem

| api | description | |-------------------|----------------------------------------------------------------------| | getLogger| Legacy API call to get logger | | setLogLevel| Legacy API call to set log level | | debug| Legacy API call to print debug log | | info| Legacy API call to print info log | | error| Legacy API call to print error log | | stringify| JSON.stringify with try-catch, multi-line format | | stringify2| JSON.stringify with try-catch, single-line format | | stringifyWithoutCircular| JSON.stringify without circular reference problem | | genHashKey| generate hash key from object (for cache key) | | debugDump| dump object with limit and pretty format | |debugEx| dump exception with pretty format | |encryptObject| encrypt object with key and iv | |decryptObject| decrypt object with key and iv | |encryptObjectWithSingleKey| encrypt object with single key, iv will use same key with variation. | |decryptObjectWithSingleKey| decrypt object with single key, iv will use same key with variation. |

export interface HttpInterface {
  status: boolean,
  message: string,
  data: any
}

export interface RestQueryRetryConfig {
  times: number,
  interval: number,
}

export interface RestQueryInterface {
  method: string,
  url: string,
  params: any,
  timeout: number,
  useCache: boolean,
  cacheTtl: number,
  retryConfig: RestQueryRetryConfig,
  headers: any,
  body: any,
  auth: any,
}

export interface RedisInitConfig {
  host: string,
  port: number,
  prefix: string,
}

export interface loggerOption {
  level: string,
  prompt: string,
  timestamp: boolean,
}

export interface MongoInterface {
  status: boolean,
  message: string,
  data: any
}

export interface MongoQueryInterface {
  name: string,
  db: string,
  collection: string,
  query: object,
  sort: object,
  fields: object,
  skip: number,
  limit: number,
  newValue: any,
  upsert: boolean,
}


export interface MongoConnectionOptions {
  poolSize: number,
  connectTimeoutMS: number,
}

export interface MongoConnectionEntry {
  name: string,
  url: string,
  options: MongoConnectionOptions,
  useCache: boolean,
  cacheTtl: number,
}

export interface MongoConnectionEntryList extends Array<MongoConnectionEntry> {}


export interface MysqlInterface {
  status: boolean,
  message: string,
  data: any
}

export interface MysqlConnectionInterface {
  host: string,
  user: string,
  password: string,
  database: string,
  useCache: boolean,
  cacheTtl: number
}

const configQuery: RestQueryInterface = {
  auth: undefined,
  body: {},
  headers: {},
  method: 'get',
  url: 'https://api.example.com/v1/config/domain/$1/service/$2',
  params: {},
  timeout: 3000,
  useCache: true,
  cacheTtl: 100,
  retryConfig: {
    times: 3,
    interval: 10,
  }
};

const mongoConnections = [
  {
    name: 'config',
    url:
      'mongodb://'
      + 'id:[email protected]:27017'
      + '?replicaSet=rs0&readPreference=secondaryPreferred',
    useCache: true,
    cacheTTL: 60,
  },
];

const queryObject = {
  name: 'config',
  db: 'configuration',
  collection: 'platform',
  query: {},
  fields: {},
  sort: {version: -1},
  skip: 0,
  limit: 1,
};