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

coderoad-es2015

v0.1.0

Published

Coderoad tutorial for learning ES2015

Downloads

5

Readme

ES2015

Practice refactoring with ES2015 features.

CodeRoad

CodeRoad is an open-sourced interactive tutorial platform for the Atom Editor. Learn more at CodeRoad.io.

Setup

  • install the tutorial package

    npm install --save coderoad-es2015

  • install and run the atom-coderoad plugin

Outline

Let

let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used.

This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.

var global = true;
let blockScoped = true;
Const

const is block-scoped, much like let statement.

However, the value of a constant cannot change through re-assignment, and it can't be redeclared.

const name = 'Shawn';
name = 'Ben'; // Uncaught TypeError
console.log(name); // Shawn

Note: Atom uses an older version of Chrome that does not fully implement const yet. Const will work in Atom after a few months.

Arrow Functions

An arrow function (=>) expression has a shorter syntax compared to function expressions and lexically binds the this value.

Arrow functions are always anonymous.

// multi-line
const add = (x, y) => {
	return x + y;
};
// single line, auto returns
const subtractOne = x => x - 1;
const getOne = () => 1;
Template Literal

Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them.

Template strings are wrapped in the backtick symbol: '`'. Variables can be put inside of template strings using ${ name } syntax.

let single = `string text`;
let multi = `string text line 1
 string text line 2`;

let template = `string text ${expression} string text`;
Object Literal

A shorthand for writing objects.

const foo = 'something';
const bar = 'else';

// using object literal shorthand
const fooObj = {
  foo, bar
};
// { foo: 'something', bar: 'else'}