If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"
npm adduser
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* | |
* Modified by Nenad Damnjanović | |
* Nov 9, 2014 |
INDEX_DIR := /home/www/project-foo | |
BUILD_DIR := $(INDEX_DIR)/build | |
JS_DEBUG := $(BUILD_DIR)/app-debug.js | |
JS_FINAL := $(BUILD_DIR)/app.js | |
CSS_COMBINED := $(BUILD_DIR)/app-combined.css | |
CSS_FINAL := $(BUILD_DIR)/app.css | |
# src files | |
JS_FILES := wrapper-head.js \ | |
utils.js \ | |
app.js \ |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
Put test1.js
and test2.js
into a tests/
directory, then run the suite:
$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
var page = require('webpage').create(), | |
url = 'http://example.com/'; | |
// Put the event handlers somewhere in the code before the action of | |
// interest (opening the page in question or clicking something) | |
// http://phantomjs.org/api/webpage/handler/on-console-message.html | |
page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); | |
}; |
Copyright (c) 2011 Max Lovenheim Irwin, http://binarymax.com | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
// Copyright 2011, Tom Switzer | |
// Under terms of ISC License: http://www.isc.org/software/license | |
/** | |
* Sorts an array of integers in linear time using bucket sort. | |
* This gives a good speed up vs. built-in sort in new JS engines | |
* (eg. V8). If a key function is given, then the result of | |
* key(a[i]) is used as the integer value to sort on instead a[i]. | |
* | |
* @param a A JavaScript array. |
/** | |
* An implementation for Quicksort. Doesn't | |
* perform as well as the native Array.sort | |
* and also runs the risk of a stack overflow | |
* | |
* Tests with: | |
* | |
* var array = []; | |
* for(var i = 0; i < 20; i++) { | |
* array.push(Math.round(Math.random() * 100)); |
[ | |
{ | |
"stream": { | |
"mature": false, | |
"status": "Greg working on Electron-Vue boilerplate w/ Akira #programming #vuejs #electron", | |
"broadcaster_language": "en", | |
"display_name": "FreeCodeCamp", | |
"game": "Creative", | |
"language": "en", | |
"_id": 79776140, |