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

six

v0.0.12

Published

JavaScript you can bet on.

Downloads

287

Readme

six  :::   JavaScript you can bet on.

Seriously, the shortest path on the Web usually is the winning play. JS is demonstrably able to grow new capabilities with less effort than a “replacement” entails. Always bet on JS! — Brendan Eich

##Elevator Six is a language super-set of JavaScript that enables new syntactic features from the 6th edition of ECMAScript to be used, through a transpiler, in your scripts today.

WARNING: Still in a very early state, proceed with caution.

You can try it out now with this interactive demo

###Usage

// Install
npm install six -g

// Execute
six myFile.js

// Compile
six --compile --output <OUTPUT> <SOURCE>
six -c -o <OUTPUT> <SOURCE>

// Watch and compile
six -cwo <OUTPUT> <SOURCE>

###Examples


// Arrow Function
[ 1, 2, 3 ].forEach( item => print(item) )

// Classes
class Person {
  constructor(name) {
    this.name = name
  }
  greet() {
    print("Hello, my name is " + this.name + ".")
  }
}

// Template Literals
var me = new Person("Matthew")
print(`Hello, my name is ${me.name}.`)

// Object Property Shorthands
var prop = "erty"

var myObj = {

  // Implicit property initialization
  prop,

  // Method definition
  method() {
    print("method")
  }

}

// Rest parameters
function x( ...args ) {}

// Destructuring
var { c, d } = { c: 1, d: 2 }

// Iterators
var stuff = ["shoes", "shirt", "shorts"]

for(var thing of stuff) {
  print(thing)
}

// Importing modules from files or node modules
module path = "path"
module local = "./local.js"

// Aliasing modules
module files = fs

// Importing content from a module
import dirname from fs

// Importing content direct from a file
import local_function from "./local.js"

// Export a function from a module.
export function mod_func() { }

// Export variables from a module.
export var a = 400, b = {}

##Module Support six outputs UMD compatible modules allowing modules to work in CommonJS environments such as node in addition to the web browser via an AMD module environment such as requirejs. Each file forms an implicit module whether a "module" declaration is used or not and thus the export (or the exports object) must be used to export data to the scope. The "-g" or "--global" command-line argument can be used to inhibit this behavior allowing code the possiblity to write directly to the global namespace when imported using an AMD module loader.

##About The Six project is building on top of the work already being done by different individuals and groups around the web. Particularly influential is the amazing work done by Ariya Hidayat and collaborators on the ECMAScript parser Esprima.

The project was started out of a desire to build on the work done with the Harmonizr project by Jason Diamond and still borrows some of its internals from that source.

A good deal of the work being done on and around the general workflows and APIs has been modeled after the very successfull CoffeeScript project by Jeremy Ashkenas.

The ability to offer a tool such as this can't possibly exist without the members of es-discuss, and all the great people involved with TC39 and standardization of the ECMAScript language.

I have a fundamental belief in the philosophies around these projects and the open web in general. I believe this platform's future is vital to us all and I want to do everything I can to help move the needle.

I'm betting on JavaScript.