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

@razroo/razzle

v1.0.2

Published

Razzle is an extensible, easy to understand, easy contribute, easy to use Codemod library.

Downloads

3

Readme

Razzle Logo Razzle Logo

Razzle is an extensible, easy to understand, easy to contribute, easy to use Codemod library. Razzle-dazzle your codebase like you've never before.

Novelty behind Razzle library

Easy To Understand

What the Razzle library does that is unique, is that it creates a unified interface across different programming languages. It uses a simple object to make modifications. e.g.

Typescript

{
  "import": '{ NgModule }',
  "path": '@angular/core'
}

SCSS

{
  "import": '',
  "path": 'libs/common/styles/razroo-styles.scss'
}

So your engineers can understand how it works for one programming language and use the same syntax for a different programming language.

Easy To Contribute

Razzle uses a tree of switch case statements to determine type of codemod to use. Simply specify programming language e.g. angular and fileType e.g. .ts and Codemod will take care of the rest.

Extensible

If you want to add your own custom codemods, or add your own, you can simply plug and play to the Razroo codemod library.

Assumption Made

Razzle is always used in an editing circumstance. There is no need to speicify that file is being edited.

Benefits of such

  1. This will be consumer facing. By allowing a singular object, we can simplify the frontend shown to users in the content management system.
  2. Developers don't have to dig into specifics for each programming language. They can simply keep an eye on the top level interface.

Further reading via Razroo blog(soon to be it's own documentation site)

blog.razroo.com

APIS Available

Typescript

  1. import
  2. editImport
  3. classDeclaration
  4. classMethod
  5. addNgModuleImport
  6. addNgModuleProvider
  7. addNgModuleImportToSpec
  8. addToVariableObject
  9. addConstructorMethod
{
  nodeType: 'addConstructorMethod',
  codeBlock: 'userService',
  type: 'UserService'
}
  1. addVariableDeclarationStatement
{
  nodeType: 'addVariableDeclarationStatement',
  codeBlock: 'gtag',
  type: 'Function'
}

JSON

  1. editJson
  2. addJsonKeyValue

SCSS

  1. addScssBlock
  2. import

Angular HTML + HTML

  1. editHtmlTag
{
  "nodeType": "editHtmlTag",
  "codeBlock": "matSort",
  "tagNameToModify": "mat-table"
}
  1. addSiblingHtml
{
  "nodeType": "addSiblingHtml",
  "codeBlock": "<script async src=\"https://www.googletagmanager.com/gtag/js?id=G-YOUR-GOOGLE-ID\"></script>",
  "tagNameToInsert": "script",
  "siblingTagName": "link"
},
  1. insertIntoHtmlTag
{
  "nodeType": "insertIntoHtmlTag",
  "codeBlock": "<div class=\"Toolbar__Icons\"><fa-icon [icon]=\"faBell\" aria-hidden=\"false\" aria-label=\"Notification Icon\"></fa-icon> <fa-icon [icon]=\"faQuestionCircle\" aria-hidden=\"false\" aria-label=\"Question Icon\"></fa-icon> <fa-icon [icon]=\"faUserCircle\" aria-hidden=\"false\" aria-label=\"Account Icon\"></fa-icon></div>",
  "tagNameToInsertInto": "mat-toolbar"
}