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

grandmas-own-jsx

v1.0.0

Published

A custom JSX transpiler that uses πŸ‘΅ because reasons.

Downloads

4

Readme

Grandma's Own JSX πŸ‘΅

You no longer need to write JSX like all your boring colleagues.

Look over your shoulder, at your colleague's code. You see this:

import React from 'react';

const MyComponent = () => {
  return (
    <div className="container">
      <h1>A Boring Component</h1>
      <p>Readable syntax is for suckers.</p>
    </div>
  );
}

Now, chuckle to yourself. Revel in your superiority, as you look back at your own, equivalent code:

//πŸ‘΅πŸ“š
// 🎁 div className="container"
// 🎩 h1
// πŸ’– _ "A Lovely Component"
// πŸ‘• p
// πŸ‘΅ _ "Syntax just like in one of Grandma's old recipe book"

import React from 'react';

const MyComponent = () => {
  return "πŸ‘΅";/*
    🎁
      🎩
        πŸ’–
      πŸ‘•
        πŸ‘΅
  */
}

Demo

You can mess about with a demo here.

How Do I Use It?

Step 1

Install it:

npm install --save grandmas-own-jsx

Step 2

Add this to your .babelrc file:

"plugins": [
  "grandmas-own-jsx"
]

or, depending on your Babel version:

"plugins": [
  "module:grandmas-own-jsx"
]

Step 3

Consider your life choices.

Explain The Syntax?

At the start of your file, you declare a list of recipes. You use a 'πŸ‘΅πŸ“š' to signal you're starting the recipe book.

//πŸ‘΅πŸ“š
// πŸ₯° div className="foo" title="bar"  <--  the emoji is the key we will use, followed by the attributes assigned to it
// πŸ₯³ MyComponent className=foo  <--  we can also use variables and custom components

To then actually render those components, use a 'πŸ‘΅' to signal that we're about to reference Grandma's recipes.

Then, we show what the DOM structure should be, showing what is a child of what.

const MyApp = 'πŸ‘΅';/*
  πŸ₯°
    πŸ₯³
*/

Why The Whole 'Grandma' Thing?

I really liked the joke of "Grandma's Old Recipe Book", since there's a reference list at the top. As I started to write this README I realised it really wasn't that funny. Covid-19 is testing me.

Picture of the Grandma from Windwaker, making soup