This file contains 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
crequire: [{ | |
string: 'require("highlight.js")', | |
path: 'highlight.js', | |
index: 7, | |
flag: null | |
}] | |
crequire: [{ | |
string: 'require("a")', | |
path: 'a', | |
index: 0, |
This file contains 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 repeat = require('repeat-string'); | |
var longest = require('longest'); | |
var wrap = require('word-wrap'); | |
var str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis'; | |
var end = repeat('*', 54); |
This file contains 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
{ options: | |
{ 'default routes': false, | |
'default engines': false, | |
'default helpers': true, | |
'router methods': [], | |
'view engine': '*', | |
debugEngine: false, | |
defaultLayout: null, | |
layoutDelims: [ '{%', '%}' ], | |
layoutTag: 'body', |
This file contains 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 through = require('through2'); | |
var PluginError = require('plugin-error'); | |
var extend = require('extend-shallow'); | |
module.exports = function (appname, name, config) { | |
var plugin = appname + '-' + name; | |
return function init(options) { | |
options = extend({}, config, options); |
This file contains 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 braces(str, open, close) { | |
var braceCount = 0; | |
var ch; | |
var pos = -1; | |
var len = str.length; | |
var res = {node: {}}; | |
var num = 0, prev, nseg = 0; | |
var brace = false; | |
while (++pos < len) { |
This file contains 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 foo() { | |
} | |
function bar() { | |
} | |
function baz(provider) { | |
var name = ' ' + provider.name || ''; | |
var fn = bar.bind(provider); | |
fn.inspect = function () { | |
return '[function' + name + ']'; | |
}; |
This file contains 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
'use strict'; | |
var path = require('path'); | |
var glob = require('globby'); | |
var App = require('template'); | |
var app = new App(); | |
app.paths = {}; | |
app.mixin('setPath', function (dest, collection, key) { |
This file contains 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 app = {options: {}}; | |
var file = {}; | |
function createGetter(file) { | |
var args = [].slice.call(arguments, 1); | |
var len = args.length, i = -1; | |
return function (prop) { | |
var cache = {}; |
This file contains 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 Base = require('base-methods'); | |
function App() { | |
Base.call(this); | |
this.define('loaded', false); | |
this.cache = {}; | |
} | |
Base.extend(App); | |
App.prototype.use = function(fn) { |
This file contains 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 App() { | |
this.views = {}; | |
this.plugins = []; | |
} | |
App.prototype.use = function (fn) { | |
var plugin = fn(this); | |
if (typeof plugin === 'function') { | |
this.plugins.push(plugin.bind(this)); | |
} |