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

arnoldjs

v0.1.0

Published

Inspired by ArnoldC, ArnoldJS adds syntactic sugar to JavaScript that lets you do less with more code.

Downloads

7

Readme

ArnoldJS

TALK TO THE HAND
    GIVE THESE PEOPLE AIR
        "Hello, World!"
    ENOUGH TALK
TERMINATED

Inspired by ArnoldC, ArnoldJS adds syntactic sugar to JavaScript that makes it less forgiving, more emotional, and even painful to write, allowing you to do less with more code.

Quotes by Arnold Schwarzenegger act as intuitive replacements for common JavaScript keywords, operators, and more. You can continue to use raw JavaScript inside ArnoldJS, and the arnoldjs transpiler will convert ArnoldJS code into raw JavaScript.

Installation

ArnoldJS requires Node.js and npm.

npm install -g arnoldjs

Usage:

arnoldjs [input-file] [output-file]

The contents of [output-file] will be replaced by the transpiled contents of [input-file]. Input files conventionally use the .ajs extension, and output files conventionally use the .js extension, though any file extensions can be provided.

As a loadable module

ArnoldJS can also be used as a module in your code to be called programatically:

npm install --save arnoldjs

Usage:

var arnoldjs = require('arnoldjs');
var ajsProgram = "TERMINATED";
var jsProgram = arnoldjs.transpile(ajsProgram); //stores ";"

Example Program

An implementation of FizzBuzz using a mix of ArnoldJS syntax and raw JavaScript:

LET'S KICK SOME ICE
GIVE THESE PEOPLE AIR
    YOU SET US UP n STICK AROUND 1;
    n <= 100;
    n STICK AROUND n GET UP 1
ENOUGH TALK
IT'S SHOWTIME
YOU SET US UP out STICK AROUND "";
BECAUSE I'M GOING TO SAY PLEASE
    (I LIED (n I LET HIM GO 3))
    out STICK AROUND out GET UP "Fizz";
BECAUSE I'M GOING TO SAY PLEASE
    (I LIED (n I LET HIM GO 5))
    out STICK AROUND out GET UP "Buzz";
TALK TO THE HAND (out
    WHAT'S WRONG WITH YOUR EYES out
    I NOW KNOW WHY YOU CRY n);
HASTA LA VISTA BABY

This program can be found in samples/fizzbuzz.ajs. Its transpiled version can be found in samples/fizzbuzz.js. Additional examples can be found in the samples directory.

Usage

The following phrases (case sensitive) on the left of the : are replaced by the value on the right.

Statements and Keywords

YOU SET US UP : var

CHILL OUT : const

NOT TO BE : null

YOUR CLOTHES GIVE THEM TO ME : new

I'M HERE : this

TO HELL WITH YOU : delete

Control Flow Statements

LISTEN TO ME VERY CAREFULLY : function

I'LL BE BACK : return

BECAUSE I'M GOING TO SAY PLEASE : if

YOU HAVE NO RESPECT FOR LOGIC : else

LET'S KICK SOME ICE : for

COOL PARTY : while

THE ICEMAN COMETH : do

GET OUT : continue

WHAT THE HELL ARE YOU : switch

KNOCK KNOCK : case

GET TO THE CHOPPER : break

I'LL KILL YOU NEXT TIME : default

TRUST ME : try

IT'S NOT A TUMOR : catch

PUT THE COOKIE DOWN : finally

Objects and object properties

BULLSHIT : false

HE'LL LIVE : true

TALK TO THE HAND : console.log

YOU ARE TERMINATED : process.exit

FOLLOW THE NUMBERS : .length

GET YOUR ASS TO MARS : .pop

HERE IS MY INVITATION : .push

THE SUBJECT BEING COPIED : .bind

LET ME TRY MINE : .call

HERE'S A COUPLE OF ACRES : .apply

Operators

STICK AROUND : =

YOU ARE NOT YOU YOU ARE ME : ===

I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE : .

GET UP : +

GET DOWN : -

YOU'RE FIRED : *

HE HAD TO SPLIT : /

I LET HIM GO : %

I LIED : !

WHAT'S WRONG WITH YOUR EYES : ?

I NOW KNOW WHY YOU CRY : :

Commonly used characters

DO IT NOW : ()

IT'S SHOWTIME : {

HASTA LA VISTA BABY : }

GIVE THESE PEOPLE AIR : (

ENOUGH TALK : )

TERMINATED : ;