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

javascwipt

v1.0.10

Published

JavaScwipt lang & transpiler

Downloads

7

Readme


Install JavaScwipt with npm:

  npm install javascwipt

Install globally (enables access to jswc compile command):

  npm install -g javascwipt

Create a .jscwipt file - src/test.jscwipt

Note: .jscwipt files must be in src directory

nya x = 'Hello World!';
console.log(x);

Compile/transpile .jscwipt files into .js or .mjs (.mjs is necessary if running with node):

jswc        # creates .js
jswc mjs    # creates .mjs

Produces - src/test.js or src/test.mjs:

let x = 'Hello World!';
console.log(x);

Use node to run the created .mjs file:

node src/test.mjs

Output:

Hello World!

General Info

JavaScript keywords cannot be used as keywords or identifiers:

// .jscwipt file:
let x = 0;        // unexpected token 'let'
nya let = 0;      // 'let' is reserved

Variable Declaration

var, let, and const are replaced by vawar, nya, and fowever:

vawar x = 0;      // var
nya y = 0;        // let
fowever z = 0;    // const

Conditionals

true, false, and null are replaced by twue, fawse, and nuwull:

nya x = twue;       // let x = true;
nya y = fawse;      // let y = false;
nya z = nuwull;     // let z = null;

if and else are replaced by iwf and ewse:

iwf () {             // if
    // code
} ewse iwf () {      // else if
    // code
} ewse {             // else
    // code
}

Loops

for is replaced with fwor:

fwor (nya i=0; i<1; i++) {      // for
    // code
}

while is replaced with duwuring:

duwuring (/* cond */) {         // while
    // code
}

do is also replaced with dowo:

dowo {                          // do
    // code
} duwuring (/* cond */);        // while

continue and break are replaced with continuwu and bweak

fwor (nya i=0; i<1; i++) {
    continuwu;                  // continue
}

duwuring (twue) {
    bweak;                      // break
}

Switch & Case

switch, case, and default are replaced by mwatch, cwase, and nowormal:

mwatch (x) {          // switch
    cwase 0:          // case
        bweak;        
    cwase 1:          // case
        bweak;
    nowormal:         // default
        bweak;
}

Functions & Methods

function is replaced by fuwunction:

fuwunction myFunc() {}                    // function

fowever myOtherFunc = fuwunction() {}     // also works

return is replaced by bacc:

fuwunction returnFunc() {
    bacc 'this is a return statement';    // return
}

Classes

class is replaced by cwass:

cwass myClass {}                          // class

extends is replaced by extwends:

cwass myChildClass extwends myClass {}    // extends

this and super are replaced by kohai and senpai:

cwass myClass {
    myMethod() {
        kohai.x = 0;                      // this
    }
}
cwass myChildClass extwends myClass {
    myMethod() {
        senpai.myMethod();                // super
    }
}

new is replaced by cweate:

nya instance = cweate myClass();          // new

Objects

in is replaced by inswide:

nya anObj = { field: 0 };
nya x = 'field' inswide anObj;         // in
// x = true

delete is replaced by boop:

nya anObj = { field: 0 };
boop anObj.field;                      // delete
// anObj = {}

instanceof is replaced by wa ... desu:

nya anObj = cweate myClass();
nya x = anObj wa myClass desu;         // instanceof
// x = true

Note: wa and desu are both considered individual keywords, so neither can be used as identifiers


Error Handling

try, catch, and finally are replaced by twy, cwatch, and finawwy:

twy {                     // try
    // code
} cwatch (err) {          // catch
    // code
} finawwy {               // finally
    // code
}

throw is replaced by nuzzle:

twy {
    // code
} cwatch (err) {
    nuzzle cweate Error(err);   // throw
}

Modules (Import & Export)

import is replaced by gwab:

gwab "foo";                  // import

export is replaced by gib:

gib fuwunction bar() {       // export
    // code
}

Other Keywords

typeof is replaced by nani:

nya x = nani 0;        // typeof
// x = 'number'

void is replaced by vowoid:

nya x = vowoid 0;      // void
// x = undefined

debugger is replaced by pweasefix:

pweasefix;             // debugger

New Keywords

JavaScwipt also has 2 new keywords that do not have JavaScript counterparts:

  • gimme
  • uwuify

(Because I'm garbage at programming, these keywords may be broken in some edge cases I didn't test.)


gimme:

Normally, in a .jscwipt file, it is not possible to use JavaScwipt keywords as identifiers:

vawar nya = 0;                    // error, 'nya' is a keyword
vawar cwass = { x: nya };         // error, 'cwass' and 'nya' are keywords
fuwunction vowoid() {}            // error, 'vowoid' is a keyword
// etc.

However, since JavaScwipt is ultimately transpiled into JavaScript, it is fine for the final .js file to use JavaScwipt keywords as identifiers.

Thus, the gimme keyword allows for JavaScwipt keywords to be used as identifiers during declaration and when accessing!

// No errors!
vawar gimme nya = 0;                     // var nya = 0;
vawar gimme cwass = { x: gimme nya };    // let cwass = { field: 0 };
fuwunction gimme vowoid() {}             // function vowoid() {}
// etc.

gimme gimme is also possible:

nya gimme gimme = 0;           // let gimme = 0;

uwuify:

The uwuify keyword can be used on strings to uwu-ify their contents:

nya x = uwuify 'test';      
// x = 'twest'

nya y = 'I love programming in JavaScript.';

nya z = uwuify y;           
// z = 'I wuv pwogwamming in JavaScwipt.'

The uwu-ify algorithm can currently be found in src/javascwipt/scwipt.util.mjs.