npm run production
- Build task that generates minified scripts for productionnpm run precommit
- Run the unit tests,, and generate a minified scriptnpm run clean
- Remove thedist
foldernpm run eslint:source
- Lint the sourcenpm run eslint:common
- Lint the unit tests shared by Karma and Mochanpm run eslint:server
- Lint the unit tests for servernpm run eslint:browser
- Lint the unit tests for browsernpm run clean
- Remove the coverage report and the dist folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/api/users', loadUsers, json) | |
router.get('/users', loadUsers, render('users/list')) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Router} 'express' | |
import {auth, logged} from 'actions/auth' | |
import {list, show} from 'actions/users' | |
import {render} from 'actions/common' | |
export default const router = Router() | |
router.use(auth) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Router} 'express' | |
export default const router = Router() | |
router.get('/items', | |
(req, res, next) => { | |
Item | |
.find() | |
.exec() | |
.catch(next) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function () { | |
function domReady (f) { /in/.test(document.readyState) ? setTimeout(domReady,16,f) : f() } | |
function resize (event) { | |
event.target.style.height = 'auto'; | |
event.target.style.height = event.target.scrollHeight+'px'; | |
} | |
/* 0-timeout to get the already changed text */ | |
function delayedResize (event) { | |
window.setTimeout(resize, 0, event); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
-moz-osx-font-smoothing: grayscale; | |
-webkit-font-smoothing: antialiased; | |
text-rendering: optimizeLegibility; | |
font-family: helvetica; | |
} | |
body{ | |
line-height: 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {App, Post} from 'geekhub'; | |
var posts = Post.find; | |
var posts = Post.find(); | |
var posts = Post.find({id: 123}); | |
var posts = Post.find({id: 123}, {id: 34}); | |
var posts = Post.find([{id: 123}, {id: 34}]); | |
var posts = Post.find({id: [123, 456, 65, 8678]}, {id: 34}); | |
var posts = Post.find([{id: [123, 456, 65, 8678]}, {id: 34}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var module = (function() { | |
var _private = { | |
i: 5, | |
get: function() { | |
console.log('Текущее значение:' + this.i); | |
}, | |
set: function(val) { | |
this.i = val; | |
}, | |
run: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var basketModule = (function() { | |
var basket = []; // приватная переменная | |
return { // методы доступные извне | |
addItem: function(values) { | |
basket.push(values); | |
}, | |
getItemCount: function() { | |
return basket.length; | |
}, | |
getTotal: function() { |