├── .gitattributes ├── .gitignore ├── Chapter 01 ├── GeoIpService.java ├── PaymentService.java └── aggregation.js ├── Chapter 02 ├── add-integer-2.js ├── add-integer.js ├── data-storage.js ├── employee-management-require.js ├── employees-storage.js ├── helloWorld.js ├── index.html ├── minimal-plugin.js ├── seneca-fail.js ├── seneca-web.js ├── string-manipulation-restructured.js ├── string-manipulation.js ├── string-require.js ├── sum-product-plugin.js └── wordcount.js ├── Chapter 03 ├── monolyth │ ├── index.js │ └── monolyth.js └── seneca-services │ ├── email.js │ ├── index.js │ ├── index2.js │ ├── node_modules │ └── seneca │ │ ├── CHANGES.md │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── lib │ │ ├── common.js │ │ ├── entity.js │ │ ├── logging.js │ │ ├── optioner.js │ │ ├── plugin-util.js │ │ ├── print.js │ │ └── store.js │ │ ├── node_modules │ │ ├── archy │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── examples │ │ │ │ ├── beep.js │ │ │ │ └── multi_line.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ └── test │ │ │ │ ├── beep.js │ │ │ │ ├── multi_line.js │ │ │ │ └── non_unicode.js │ │ ├── eraro │ │ │ ├── README.md │ │ │ ├── eraro.js │ │ │ └── package.json │ │ ├── gate-executor │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── doc │ │ │ │ ├── docco.css │ │ │ │ ├── gate-executor.html │ │ │ │ └── public │ │ │ │ │ ├── fonts │ │ │ │ │ ├── aller-bold.eot │ │ │ │ │ ├── aller-bold.ttf │ │ │ │ │ ├── aller-bold.woff │ │ │ │ │ ├── aller-light.eot │ │ │ │ │ ├── aller-light.ttf │ │ │ │ │ ├── aller-light.woff │ │ │ │ │ ├── novecento-bold.eot │ │ │ │ │ ├── novecento-bold.ttf │ │ │ │ │ ├── novecento-bold.woff │ │ │ │ │ ├── roboto-black.eot │ │ │ │ │ ├── roboto-black.ttf │ │ │ │ │ └── roboto-black.woff │ │ │ │ │ └── stylesheets │ │ │ │ │ └── normalize.css │ │ │ ├── gate-executor.js │ │ │ ├── node_modules │ │ │ │ └── async │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bower.json │ │ │ │ │ ├── component.json │ │ │ │ │ ├── lib │ │ │ │ │ └── async.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── support │ │ │ │ │ └── sync-package-managers.js │ │ │ ├── package.json │ │ │ ├── test.sh │ │ │ └── test │ │ │ │ └── gate-executor.test.js │ │ ├── gex │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── gex-min.js │ │ │ ├── gex-min.map │ │ │ ├── gex.js │ │ │ └── package.json │ │ ├── jsonic │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── jsonic-min.js │ │ │ ├── jsonic-min.map │ │ │ ├── jsonic-parser.js │ │ │ ├── jsonic-parser.pegjs │ │ │ ├── jsonic.js │ │ │ └── package.json │ │ ├── lodash │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── lodash.compat.js │ │ │ │ ├── lodash.compat.min.js │ │ │ │ ├── lodash.js │ │ │ │ ├── lodash.min.js │ │ │ │ ├── lodash.underscore.js │ │ │ │ └── lodash.underscore.min.js │ │ │ ├── lodash.js │ │ │ └── package.json │ │ ├── lru-cache │ │ │ ├── .npmignore │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ └── lru-cache.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── basic.js │ │ │ │ ├── foreach.js │ │ │ │ └── memory-leak.js │ │ ├── minimist │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── example │ │ │ │ └── parse.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ └── test │ │ │ │ ├── all_bool.js │ │ │ │ ├── bool.js │ │ │ │ ├── dash.js │ │ │ │ ├── default_bool.js │ │ │ │ ├── dotted.js │ │ │ │ ├── long.js │ │ │ │ ├── num.js │ │ │ │ ├── parse.js │ │ │ │ ├── parse_modified.js │ │ │ │ ├── short.js │ │ │ │ ├── stop_early.js │ │ │ │ ├── unknown.js │ │ │ │ └── whitespace.js │ │ ├── nid │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── nid.js │ │ │ └── package.json │ │ ├── norma │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── doc │ │ │ │ ├── docco.css │ │ │ │ ├── norma.html │ │ │ │ └── public │ │ │ │ │ ├── fonts │ │ │ │ │ ├── aller-bold.eot │ │ │ │ │ ├── aller-bold.ttf │ │ │ │ │ ├── aller-bold.woff │ │ │ │ │ ├── aller-light.eot │ │ │ │ │ ├── aller-light.ttf │ │ │ │ │ ├── aller-light.woff │ │ │ │ │ ├── novecento-bold.eot │ │ │ │ │ ├── novecento-bold.ttf │ │ │ │ │ └── novecento-bold.woff │ │ │ │ │ └── stylesheets │ │ │ │ │ └── normalize.css │ │ │ ├── norma-min.js │ │ │ ├── norma-min.map │ │ │ ├── norma-parser.js │ │ │ ├── norma-parser.pegjs │ │ │ ├── norma.js │ │ │ ├── package.json │ │ │ ├── test.sh │ │ │ └── test │ │ │ │ ├── norma.test.js │ │ │ │ └── readme.js │ │ ├── parambulator │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── node_modules │ │ │ │ └── jsonic │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── jsonic-min.js │ │ │ │ │ ├── jsonic-min.map │ │ │ │ │ ├── jsonic-parser.js │ │ │ │ │ ├── jsonic-parser.pegjs │ │ │ │ │ ├── jsonic.js │ │ │ │ │ └── package.json │ │ │ ├── package.json │ │ │ └── parambulator.js │ │ ├── patrun │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── node_modules │ │ │ │ ├── gex │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ ├── README.md │ │ │ │ │ ├── gex-min.js │ │ │ │ │ ├── gex-min.map │ │ │ │ │ ├── gex.js │ │ │ │ │ └── package.json │ │ │ │ └── lodash │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── array.js │ │ │ │ │ ├── array │ │ │ │ │ ├── chunk.js │ │ │ │ │ ├── compact.js │ │ │ │ │ ├── difference.js │ │ │ │ │ ├── drop.js │ │ │ │ │ ├── dropRight.js │ │ │ │ │ ├── dropRightWhile.js │ │ │ │ │ ├── dropWhile.js │ │ │ │ │ ├── fill.js │ │ │ │ │ ├── findIndex.js │ │ │ │ │ ├── findLastIndex.js │ │ │ │ │ ├── first.js │ │ │ │ │ ├── flatten.js │ │ │ │ │ ├── flattenDeep.js │ │ │ │ │ ├── head.js │ │ │ │ │ ├── indexOf.js │ │ │ │ │ ├── initial.js │ │ │ │ │ ├── intersection.js │ │ │ │ │ ├── last.js │ │ │ │ │ ├── lastIndexOf.js │ │ │ │ │ ├── object.js │ │ │ │ │ ├── pull.js │ │ │ │ │ ├── pullAt.js │ │ │ │ │ ├── remove.js │ │ │ │ │ ├── rest.js │ │ │ │ │ ├── slice.js │ │ │ │ │ ├── sortedIndex.js │ │ │ │ │ ├── sortedLastIndex.js │ │ │ │ │ ├── tail.js │ │ │ │ │ ├── take.js │ │ │ │ │ ├── takeRight.js │ │ │ │ │ ├── takeRightWhile.js │ │ │ │ │ ├── takeWhile.js │ │ │ │ │ ├── union.js │ │ │ │ │ ├── uniq.js │ │ │ │ │ ├── unique.js │ │ │ │ │ ├── unzip.js │ │ │ │ │ ├── unzipWith.js │ │ │ │ │ ├── without.js │ │ │ │ │ ├── xor.js │ │ │ │ │ ├── zip.js │ │ │ │ │ ├── zipObject.js │ │ │ │ │ └── zipWith.js │ │ │ │ │ ├── chain.js │ │ │ │ │ ├── chain │ │ │ │ │ ├── chain.js │ │ │ │ │ ├── commit.js │ │ │ │ │ ├── concat.js │ │ │ │ │ ├── lodash.js │ │ │ │ │ ├── plant.js │ │ │ │ │ ├── reverse.js │ │ │ │ │ ├── run.js │ │ │ │ │ ├── tap.js │ │ │ │ │ ├── thru.js │ │ │ │ │ ├── toJSON.js │ │ │ │ │ ├── toString.js │ │ │ │ │ ├── value.js │ │ │ │ │ ├── valueOf.js │ │ │ │ │ ├── wrapperChain.js │ │ │ │ │ ├── wrapperCommit.js │ │ │ │ │ ├── wrapperConcat.js │ │ │ │ │ ├── wrapperPlant.js │ │ │ │ │ ├── wrapperReverse.js │ │ │ │ │ ├── wrapperToString.js │ │ │ │ │ └── wrapperValue.js │ │ │ │ │ ├── collection.js │ │ │ │ │ ├── collection │ │ │ │ │ ├── all.js │ │ │ │ │ ├── any.js │ │ │ │ │ ├── at.js │ │ │ │ │ ├── collect.js │ │ │ │ │ ├── contains.js │ │ │ │ │ ├── countBy.js │ │ │ │ │ ├── detect.js │ │ │ │ │ ├── each.js │ │ │ │ │ ├── eachRight.js │ │ │ │ │ ├── every.js │ │ │ │ │ ├── filter.js │ │ │ │ │ ├── find.js │ │ │ │ │ ├── findLast.js │ │ │ │ │ ├── findWhere.js │ │ │ │ │ ├── foldl.js │ │ │ │ │ ├── foldr.js │ │ │ │ │ ├── forEach.js │ │ │ │ │ ├── forEachRight.js │ │ │ │ │ ├── groupBy.js │ │ │ │ │ ├── include.js │ │ │ │ │ ├── includes.js │ │ │ │ │ ├── indexBy.js │ │ │ │ │ ├── inject.js │ │ │ │ │ ├── invoke.js │ │ │ │ │ ├── map.js │ │ │ │ │ ├── max.js │ │ │ │ │ ├── min.js │ │ │ │ │ ├── partition.js │ │ │ │ │ ├── pluck.js │ │ │ │ │ ├── reduce.js │ │ │ │ │ ├── reduceRight.js │ │ │ │ │ ├── reject.js │ │ │ │ │ ├── sample.js │ │ │ │ │ ├── select.js │ │ │ │ │ ├── shuffle.js │ │ │ │ │ ├── size.js │ │ │ │ │ ├── some.js │ │ │ │ │ ├── sortBy.js │ │ │ │ │ ├── sortByAll.js │ │ │ │ │ ├── sortByOrder.js │ │ │ │ │ ├── sum.js │ │ │ │ │ └── where.js │ │ │ │ │ ├── date.js │ │ │ │ │ ├── date │ │ │ │ │ └── now.js │ │ │ │ │ ├── function.js │ │ │ │ │ ├── function │ │ │ │ │ ├── after.js │ │ │ │ │ ├── ary.js │ │ │ │ │ ├── backflow.js │ │ │ │ │ ├── before.js │ │ │ │ │ ├── bind.js │ │ │ │ │ ├── bindAll.js │ │ │ │ │ ├── bindKey.js │ │ │ │ │ ├── compose.js │ │ │ │ │ ├── curry.js │ │ │ │ │ ├── curryRight.js │ │ │ │ │ ├── debounce.js │ │ │ │ │ ├── defer.js │ │ │ │ │ ├── delay.js │ │ │ │ │ ├── flow.js │ │ │ │ │ ├── flowRight.js │ │ │ │ │ ├── memoize.js │ │ │ │ │ ├── modArgs.js │ │ │ │ │ ├── negate.js │ │ │ │ │ ├── once.js │ │ │ │ │ ├── partial.js │ │ │ │ │ ├── partialRight.js │ │ │ │ │ ├── rearg.js │ │ │ │ │ ├── restParam.js │ │ │ │ │ ├── spread.js │ │ │ │ │ ├── throttle.js │ │ │ │ │ └── wrap.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── internal │ │ │ │ │ ├── LazyWrapper.js │ │ │ │ │ ├── LodashWrapper.js │ │ │ │ │ ├── MapCache.js │ │ │ │ │ ├── SetCache.js │ │ │ │ │ ├── arrayConcat.js │ │ │ │ │ ├── arrayCopy.js │ │ │ │ │ ├── arrayEach.js │ │ │ │ │ ├── arrayEachRight.js │ │ │ │ │ ├── arrayEvery.js │ │ │ │ │ ├── arrayExtremum.js │ │ │ │ │ ├── arrayFilter.js │ │ │ │ │ ├── arrayMap.js │ │ │ │ │ ├── arrayPush.js │ │ │ │ │ ├── arrayReduce.js │ │ │ │ │ ├── arrayReduceRight.js │ │ │ │ │ ├── arraySome.js │ │ │ │ │ ├── arraySum.js │ │ │ │ │ ├── assignDefaults.js │ │ │ │ │ ├── assignOwnDefaults.js │ │ │ │ │ ├── assignWith.js │ │ │ │ │ ├── baseAssign.js │ │ │ │ │ ├── baseAt.js │ │ │ │ │ ├── baseCallback.js │ │ │ │ │ ├── baseClone.js │ │ │ │ │ ├── baseCompareAscending.js │ │ │ │ │ ├── baseCopy.js │ │ │ │ │ ├── baseCreate.js │ │ │ │ │ ├── baseDelay.js │ │ │ │ │ ├── baseDifference.js │ │ │ │ │ ├── baseEach.js │ │ │ │ │ ├── baseEachRight.js │ │ │ │ │ ├── baseEvery.js │ │ │ │ │ ├── baseExtremum.js │ │ │ │ │ ├── baseFill.js │ │ │ │ │ ├── baseFilter.js │ │ │ │ │ ├── baseFind.js │ │ │ │ │ ├── baseFindIndex.js │ │ │ │ │ ├── baseFlatten.js │ │ │ │ │ ├── baseFor.js │ │ │ │ │ ├── baseForIn.js │ │ │ │ │ ├── baseForOwn.js │ │ │ │ │ ├── baseForOwnRight.js │ │ │ │ │ ├── baseForRight.js │ │ │ │ │ ├── baseFunctions.js │ │ │ │ │ ├── baseGet.js │ │ │ │ │ ├── baseIndexOf.js │ │ │ │ │ ├── baseIsEqual.js │ │ │ │ │ ├── baseIsEqualDeep.js │ │ │ │ │ ├── baseIsFunction.js │ │ │ │ │ ├── baseIsMatch.js │ │ │ │ │ ├── baseLodash.js │ │ │ │ │ ├── baseMap.js │ │ │ │ │ ├── baseMatches.js │ │ │ │ │ ├── baseMatchesProperty.js │ │ │ │ │ ├── baseMerge.js │ │ │ │ │ ├── baseMergeDeep.js │ │ │ │ │ ├── baseProperty.js │ │ │ │ │ ├── basePropertyDeep.js │ │ │ │ │ ├── basePullAt.js │ │ │ │ │ ├── baseRandom.js │ │ │ │ │ ├── baseReduce.js │ │ │ │ │ ├── baseSetData.js │ │ │ │ │ ├── baseSlice.js │ │ │ │ │ ├── baseSome.js │ │ │ │ │ ├── baseSortBy.js │ │ │ │ │ ├── baseSortByOrder.js │ │ │ │ │ ├── baseSum.js │ │ │ │ │ ├── baseToString.js │ │ │ │ │ ├── baseUniq.js │ │ │ │ │ ├── baseValues.js │ │ │ │ │ ├── baseWhile.js │ │ │ │ │ ├── baseWrapperValue.js │ │ │ │ │ ├── binaryIndex.js │ │ │ │ │ ├── binaryIndexBy.js │ │ │ │ │ ├── bindCallback.js │ │ │ │ │ ├── bufferClone.js │ │ │ │ │ ├── cacheIndexOf.js │ │ │ │ │ ├── cachePush.js │ │ │ │ │ ├── charsLeftIndex.js │ │ │ │ │ ├── charsRightIndex.js │ │ │ │ │ ├── compareAscending.js │ │ │ │ │ ├── compareMultiple.js │ │ │ │ │ ├── composeArgs.js │ │ │ │ │ ├── composeArgsRight.js │ │ │ │ │ ├── createAggregator.js │ │ │ │ │ ├── createAssigner.js │ │ │ │ │ ├── createBaseEach.js │ │ │ │ │ ├── createBaseFor.js │ │ │ │ │ ├── createBindWrapper.js │ │ │ │ │ ├── createCache.js │ │ │ │ │ ├── createCompounder.js │ │ │ │ │ ├── createCtorWrapper.js │ │ │ │ │ ├── createCurry.js │ │ │ │ │ ├── createDefaults.js │ │ │ │ │ ├── createExtremum.js │ │ │ │ │ ├── createFind.js │ │ │ │ │ ├── createFindIndex.js │ │ │ │ │ ├── createFindKey.js │ │ │ │ │ ├── createFlow.js │ │ │ │ │ ├── createForEach.js │ │ │ │ │ ├── createForIn.js │ │ │ │ │ ├── createForOwn.js │ │ │ │ │ ├── createHybridWrapper.js │ │ │ │ │ ├── createObjectMapper.js │ │ │ │ │ ├── createPadDir.js │ │ │ │ │ ├── createPadding.js │ │ │ │ │ ├── createPartial.js │ │ │ │ │ ├── createPartialWrapper.js │ │ │ │ │ ├── createReduce.js │ │ │ │ │ ├── createRound.js │ │ │ │ │ ├── createSortedIndex.js │ │ │ │ │ ├── createWrapper.js │ │ │ │ │ ├── deburrLetter.js │ │ │ │ │ ├── equalArrays.js │ │ │ │ │ ├── equalByTag.js │ │ │ │ │ ├── equalObjects.js │ │ │ │ │ ├── escapeHtmlChar.js │ │ │ │ │ ├── escapeRegExpChar.js │ │ │ │ │ ├── escapeStringChar.js │ │ │ │ │ ├── getData.js │ │ │ │ │ ├── getFuncName.js │ │ │ │ │ ├── getLength.js │ │ │ │ │ ├── getMatchData.js │ │ │ │ │ ├── getNative.js │ │ │ │ │ ├── getView.js │ │ │ │ │ ├── indexOfNaN.js │ │ │ │ │ ├── initCloneArray.js │ │ │ │ │ ├── initCloneByTag.js │ │ │ │ │ ├── initCloneObject.js │ │ │ │ │ ├── invokePath.js │ │ │ │ │ ├── isArrayLike.js │ │ │ │ │ ├── isIndex.js │ │ │ │ │ ├── isIterateeCall.js │ │ │ │ │ ├── isKey.js │ │ │ │ │ ├── isLaziable.js │ │ │ │ │ ├── isLength.js │ │ │ │ │ ├── isObjectLike.js │ │ │ │ │ ├── isSpace.js │ │ │ │ │ ├── isStrictComparable.js │ │ │ │ │ ├── lazyClone.js │ │ │ │ │ ├── lazyReverse.js │ │ │ │ │ ├── lazyValue.js │ │ │ │ │ ├── mapDelete.js │ │ │ │ │ ├── mapGet.js │ │ │ │ │ ├── mapHas.js │ │ │ │ │ ├── mapSet.js │ │ │ │ │ ├── mergeData.js │ │ │ │ │ ├── mergeDefaults.js │ │ │ │ │ ├── metaMap.js │ │ │ │ │ ├── pickByArray.js │ │ │ │ │ ├── pickByCallback.js │ │ │ │ │ ├── reEscape.js │ │ │ │ │ ├── reEvaluate.js │ │ │ │ │ ├── reInterpolate.js │ │ │ │ │ ├── realNames.js │ │ │ │ │ ├── reorder.js │ │ │ │ │ ├── replaceHolders.js │ │ │ │ │ ├── setData.js │ │ │ │ │ ├── shimKeys.js │ │ │ │ │ ├── sortedUniq.js │ │ │ │ │ ├── toIterable.js │ │ │ │ │ ├── toObject.js │ │ │ │ │ ├── toPath.js │ │ │ │ │ ├── trimmedLeftIndex.js │ │ │ │ │ ├── trimmedRightIndex.js │ │ │ │ │ ├── unescapeHtmlChar.js │ │ │ │ │ └── wrapperClone.js │ │ │ │ │ ├── lang.js │ │ │ │ │ ├── lang │ │ │ │ │ ├── clone.js │ │ │ │ │ ├── cloneDeep.js │ │ │ │ │ ├── eq.js │ │ │ │ │ ├── gt.js │ │ │ │ │ ├── gte.js │ │ │ │ │ ├── isArguments.js │ │ │ │ │ ├── isArray.js │ │ │ │ │ ├── isBoolean.js │ │ │ │ │ ├── isDate.js │ │ │ │ │ ├── isElement.js │ │ │ │ │ ├── isEmpty.js │ │ │ │ │ ├── isEqual.js │ │ │ │ │ ├── isError.js │ │ │ │ │ ├── isFinite.js │ │ │ │ │ ├── isFunction.js │ │ │ │ │ ├── isMatch.js │ │ │ │ │ ├── isNaN.js │ │ │ │ │ ├── isNative.js │ │ │ │ │ ├── isNull.js │ │ │ │ │ ├── isNumber.js │ │ │ │ │ ├── isObject.js │ │ │ │ │ ├── isPlainObject.js │ │ │ │ │ ├── isRegExp.js │ │ │ │ │ ├── isString.js │ │ │ │ │ ├── isTypedArray.js │ │ │ │ │ ├── isUndefined.js │ │ │ │ │ ├── lt.js │ │ │ │ │ ├── lte.js │ │ │ │ │ ├── toArray.js │ │ │ │ │ └── toPlainObject.js │ │ │ │ │ ├── math.js │ │ │ │ │ ├── math │ │ │ │ │ ├── add.js │ │ │ │ │ ├── ceil.js │ │ │ │ │ ├── floor.js │ │ │ │ │ ├── max.js │ │ │ │ │ ├── min.js │ │ │ │ │ ├── round.js │ │ │ │ │ └── sum.js │ │ │ │ │ ├── number.js │ │ │ │ │ ├── number │ │ │ │ │ ├── inRange.js │ │ │ │ │ └── random.js │ │ │ │ │ ├── object.js │ │ │ │ │ ├── object │ │ │ │ │ ├── assign.js │ │ │ │ │ ├── create.js │ │ │ │ │ ├── defaults.js │ │ │ │ │ ├── defaultsDeep.js │ │ │ │ │ ├── extend.js │ │ │ │ │ ├── findKey.js │ │ │ │ │ ├── findLastKey.js │ │ │ │ │ ├── forIn.js │ │ │ │ │ ├── forInRight.js │ │ │ │ │ ├── forOwn.js │ │ │ │ │ ├── forOwnRight.js │ │ │ │ │ ├── functions.js │ │ │ │ │ ├── get.js │ │ │ │ │ ├── has.js │ │ │ │ │ ├── invert.js │ │ │ │ │ ├── keys.js │ │ │ │ │ ├── keysIn.js │ │ │ │ │ ├── mapKeys.js │ │ │ │ │ ├── mapValues.js │ │ │ │ │ ├── merge.js │ │ │ │ │ ├── methods.js │ │ │ │ │ ├── omit.js │ │ │ │ │ ├── pairs.js │ │ │ │ │ ├── pick.js │ │ │ │ │ ├── result.js │ │ │ │ │ ├── set.js │ │ │ │ │ ├── transform.js │ │ │ │ │ ├── values.js │ │ │ │ │ └── valuesIn.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── string.js │ │ │ │ │ ├── string │ │ │ │ │ ├── camelCase.js │ │ │ │ │ ├── capitalize.js │ │ │ │ │ ├── deburr.js │ │ │ │ │ ├── endsWith.js │ │ │ │ │ ├── escape.js │ │ │ │ │ ├── escapeRegExp.js │ │ │ │ │ ├── kebabCase.js │ │ │ │ │ ├── pad.js │ │ │ │ │ ├── padLeft.js │ │ │ │ │ ├── padRight.js │ │ │ │ │ ├── parseInt.js │ │ │ │ │ ├── repeat.js │ │ │ │ │ ├── snakeCase.js │ │ │ │ │ ├── startCase.js │ │ │ │ │ ├── startsWith.js │ │ │ │ │ ├── template.js │ │ │ │ │ ├── templateSettings.js │ │ │ │ │ ├── trim.js │ │ │ │ │ ├── trimLeft.js │ │ │ │ │ ├── trimRight.js │ │ │ │ │ ├── trunc.js │ │ │ │ │ ├── unescape.js │ │ │ │ │ └── words.js │ │ │ │ │ ├── support.js │ │ │ │ │ ├── utility.js │ │ │ │ │ └── utility │ │ │ │ │ ├── attempt.js │ │ │ │ │ ├── callback.js │ │ │ │ │ ├── constant.js │ │ │ │ │ ├── identity.js │ │ │ │ │ ├── iteratee.js │ │ │ │ │ ├── matches.js │ │ │ │ │ ├── matchesProperty.js │ │ │ │ │ ├── method.js │ │ │ │ │ ├── methodOf.js │ │ │ │ │ ├── mixin.js │ │ │ │ │ ├── noop.js │ │ │ │ │ ├── property.js │ │ │ │ │ ├── propertyOf.js │ │ │ │ │ ├── range.js │ │ │ │ │ ├── times.js │ │ │ │ │ └── uniqueId.js │ │ │ ├── package.json │ │ │ ├── patrun-min.js │ │ │ ├── patrun-min.map │ │ │ └── patrun.js │ │ ├── rolling-stats │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ └── rolling-stats.js │ │ ├── seneca-basic │ │ │ ├── README.md │ │ │ ├── basic.js │ │ │ ├── node_modules │ │ │ │ └── async │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bower.json │ │ │ │ │ ├── component.json │ │ │ │ │ ├── lib │ │ │ │ │ └── async.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── support │ │ │ │ │ └── sync-package-managers.js │ │ │ └── package.json │ │ ├── seneca-mem-store │ │ │ ├── README.md │ │ │ ├── mem-store.js │ │ │ └── package.json │ │ ├── seneca-transport │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ └── transport-utils.js │ │ │ ├── node_modules │ │ │ │ ├── .bin │ │ │ │ │ └── needle │ │ │ │ ├── async │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bower.json │ │ │ │ │ ├── component.json │ │ │ │ │ ├── lib │ │ │ │ │ │ └── async.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── support │ │ │ │ │ │ └── sync-package-managers.js │ │ │ │ ├── connect-query │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── qs │ │ │ │ │ │ │ ├── .jshintignore │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── parse.js │ │ │ │ │ │ │ ├── stringify.js │ │ │ │ │ │ │ └── utils.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── test │ │ │ │ │ │ │ ├── parse.js │ │ │ │ │ │ │ └── stringify.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ │ └── index.js │ │ │ │ ├── connect-timeout │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── http-errors │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ ├── inherits │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── inherits.js │ │ │ │ │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ │ └── statuses │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── codes.json │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── ms │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── on-headers │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ │ ├── connect │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── History.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── connect.js │ │ │ │ │ │ └── proto.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ └── ms │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── finalhandler │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ │ └── ms │ │ │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── escape-html │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── parseurl │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── utils-merge │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ │ ├── jsonic │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── jsonic-min.js │ │ │ │ │ ├── jsonic-min.map │ │ │ │ │ ├── jsonic-parser.js │ │ │ │ │ ├── jsonic-parser.pegjs │ │ │ │ │ ├── jsonic.js │ │ │ │ │ └── package.json │ │ │ │ ├── needle │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bin │ │ │ │ │ │ └── needle │ │ │ │ │ ├── examples │ │ │ │ │ │ ├── deflated-stream.js │ │ │ │ │ │ ├── digest-auth.js │ │ │ │ │ │ ├── download-to-file.js │ │ │ │ │ │ ├── multipart-stream.js │ │ │ │ │ │ ├── parsed-stream.js │ │ │ │ │ │ ├── parsed-stream2.js │ │ │ │ │ │ ├── stream-events.js │ │ │ │ │ │ ├── stream-to-file.js │ │ │ │ │ │ └── upload-image.js │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── auth.js │ │ │ │ │ │ ├── cookies.js │ │ │ │ │ │ ├── decoder.js │ │ │ │ │ │ ├── multipart.js │ │ │ │ │ │ ├── needle.js │ │ │ │ │ │ ├── parsers.js │ │ │ │ │ │ └── querystring.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ └── ms │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── iconv-lite │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ ├── Changelog.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── encodings │ │ │ │ │ │ │ ├── dbcs-codec.js │ │ │ │ │ │ │ ├── dbcs-data.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── internal.js │ │ │ │ │ │ │ ├── sbcs-codec.js │ │ │ │ │ │ │ ├── sbcs-data-generated.js │ │ │ │ │ │ │ ├── sbcs-data.js │ │ │ │ │ │ │ ├── tables │ │ │ │ │ │ │ │ ├── big5-added.json │ │ │ │ │ │ │ │ ├── cp936.json │ │ │ │ │ │ │ │ ├── cp949.json │ │ │ │ │ │ │ │ ├── cp950.json │ │ │ │ │ │ │ │ ├── eucjp.json │ │ │ │ │ │ │ │ ├── gb18030-ranges.json │ │ │ │ │ │ │ │ ├── gbk-added.json │ │ │ │ │ │ │ │ └── shiftjis.json │ │ │ │ │ │ │ ├── utf16.js │ │ │ │ │ │ │ └── utf7.js │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ ├── bom-handling.js │ │ │ │ │ │ │ ├── extend-node.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── streams.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ │ ├── basic_auth_spec.js │ │ │ │ │ │ ├── compression_spec.js │ │ │ │ │ │ ├── cookies_spec.js │ │ │ │ │ │ ├── cookies_spec.js.orig │ │ │ │ │ │ ├── decoder_spec.js │ │ │ │ │ │ ├── errors_spec.js │ │ │ │ │ │ ├── helpers.js │ │ │ │ │ │ ├── keys │ │ │ │ │ │ ├── ssl.cert │ │ │ │ │ │ └── ssl.key │ │ │ │ │ │ ├── parsing_spec.js │ │ │ │ │ │ ├── proxy_spec.js │ │ │ │ │ │ ├── querystring_spec.js │ │ │ │ │ │ ├── redirect_spec.js │ │ │ │ │ │ ├── stream_spec.js │ │ │ │ │ │ └── utils │ │ │ │ │ │ ├── formidable.js │ │ │ │ │ │ ├── proxy.js │ │ │ │ │ │ └── test.js │ │ │ │ ├── patrun │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── package.json │ │ │ │ │ ├── patrun-min.js │ │ │ │ │ ├── patrun-min.map │ │ │ │ │ └── patrun.js │ │ │ │ └── reconnect-net │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── node_modules │ │ │ │ │ └── reconnect-core │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── backoff │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ ├── CHANGES.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── doc │ │ │ │ │ │ │ └── layers.png │ │ │ │ │ │ │ ├── examples │ │ │ │ │ │ │ ├── fail.js │ │ │ │ │ │ │ ├── readme.js │ │ │ │ │ │ │ └── reset.js │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ ├── backoff.js │ │ │ │ │ │ │ └── function_call.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── tests │ │ │ │ │ │ │ ├── api.js │ │ │ │ │ │ │ └── backoff.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── test │ │ │ │ │ │ ├── attempts.js │ │ │ │ │ │ ├── connection.js │ │ │ │ │ │ ├── disconnect.js │ │ │ │ │ │ ├── onconnect-listener.js │ │ │ │ │ │ └── reconnection.js │ │ │ │ │ └── package.json │ │ │ ├── package.json │ │ │ └── transport.js │ │ ├── seneca-web │ │ │ ├── README.md │ │ │ ├── http-router.js │ │ │ ├── node_modules │ │ │ │ ├── connect │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── History.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── connect.js │ │ │ │ │ │ └── proto.js │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ └── ms │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── finalhandler │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ │ └── ms │ │ │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── escape-html │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── parseurl │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── utils-merge │ │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ │ ├── json-stringify-safe │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── CHANGELOG.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── README.md │ │ │ │ │ ├── package.json │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── test │ │ │ │ │ │ ├── mocha.opts │ │ │ │ │ │ └── stringify_test.js │ │ │ │ ├── mstring │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ ├── README.md │ │ │ │ │ ├── mstring.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test.js │ │ │ │ └── serve-static │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── node_modules │ │ │ │ │ ├── escape-html │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── parseurl │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── send │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ ├── .bin │ │ │ │ │ │ │ │ └── mime │ │ │ │ │ │ │ ├── debug │ │ │ │ │ │ │ │ ├── .jshintrc │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ │ │ ├── browser.js │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ ├── debug.js │ │ │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── depd │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ │ └── compat │ │ │ │ │ │ │ │ │ │ ├── buffer-concat.js │ │ │ │ │ │ │ │ │ │ ├── callsite-tostring.js │ │ │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── destroy │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── etag │ │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ └── crc │ │ │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ │ │ ├── crc.js │ │ │ │ │ │ │ │ │ │ ├── crc1.js │ │ │ │ │ │ │ │ │ │ ├── crc16.js │ │ │ │ │ │ │ │ │ │ ├── crc16_ccitt.js │ │ │ │ │ │ │ │ │ │ ├── crc16_modbus.js │ │ │ │ │ │ │ │ │ │ ├── crc24.js │ │ │ │ │ │ │ │ │ │ ├── crc32.js │ │ │ │ │ │ │ │ │ │ ├── crc8.js │ │ │ │ │ │ │ │ │ │ ├── crc8_1wire.js │ │ │ │ │ │ │ │ │ │ ├── create.js │ │ │ │ │ │ │ │ │ │ ├── hex.js │ │ │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── fresh │ │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── mime │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── build │ │ │ │ │ │ │ │ │ ├── build.js │ │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ │ ├── cli.js │ │ │ │ │ │ │ │ ├── mime.js │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ └── types.json │ │ │ │ │ │ │ ├── ms │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ ├── on-finished │ │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ │ └── ee-first │ │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ │ └── range-parser │ │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── package.json │ │ │ │ │ └── utils-merge │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ ├── package.json │ │ │ ├── web.js │ │ │ └── web │ │ │ │ ├── _web_service_template.html │ │ │ │ ├── angular-1.2.0.rc2.js │ │ │ │ ├── angular-route-1.2.0.rc2.js │ │ │ │ ├── animate.css │ │ │ │ ├── bootstrap-v3.0.0.js │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── jquery-2.0.0.js │ │ │ │ ├── login-web.js │ │ │ │ ├── moment-2.3.1.min.js │ │ │ │ ├── underscore-1.5.2.js │ │ │ │ └── web-service.js │ │ ├── use-plugin │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ └── use.js │ │ └── zig │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── doc │ │ │ ├── docco.css │ │ │ ├── public │ │ │ │ ├── fonts │ │ │ │ │ ├── aller-bold.eot │ │ │ │ │ ├── aller-bold.ttf │ │ │ │ │ ├── aller-bold.woff │ │ │ │ │ ├── aller-light.eot │ │ │ │ │ ├── aller-light.ttf │ │ │ │ │ ├── aller-light.woff │ │ │ │ │ ├── novecento-bold.eot │ │ │ │ │ ├── novecento-bold.ttf │ │ │ │ │ └── novecento-bold.woff │ │ │ │ └── stylesheets │ │ │ │ │ └── normalize.css │ │ │ └── zig.html │ │ │ ├── examples │ │ │ ├── mongo.js │ │ │ ├── package.json │ │ │ ├── readme.js │ │ │ └── readme.js~ │ │ │ ├── package.json │ │ │ ├── test.sh │ │ │ ├── test │ │ │ └── zig.test.js │ │ │ └── zig.js │ │ ├── package.json │ │ └── seneca.js │ ├── post.js │ └── sms.js ├── Chapter 04 ├── README.md ├── emailing │ ├── README.md │ ├── app │ │ ├── index.js │ │ ├── nodemailer.js │ │ └── test.js │ └── package.json ├── front-end │ ├── README.md │ ├── app │ │ ├── index.js │ │ └── test.js │ └── package.json ├── order-manager │ ├── README.md │ ├── app │ │ ├── .index.js.swo │ │ └── index.js │ └── package.json ├── product-management │ ├── README.md │ ├── app │ │ └── index.js │ └── package.json └── snippets.js ├── Chapter 05 ├── escapedsql.js └── sqlinjection.js ├── Chapter 06 ├── chai-http-tests.js ├── chai.js ├── coverage │ ├── coverage.json │ ├── lcov-report │ │ ├── base.css │ │ ├── code │ │ │ ├── index.html │ │ │ ├── remove-stop-words.js.html │ │ │ └── stop-words-tests.js.html │ │ ├── index.html │ │ ├── prettify.css │ │ ├── prettify.js │ │ ├── sort-arrow-sprite.png │ │ └── sorter.js │ └── lcov.info ├── david.js ├── main-banned.js ├── mocha.js ├── package.json ├── proxy.js ├── remove-stop-words.js ├── sinon-stub.js ├── sinon-time.js ├── sinon.js ├── start-stop.js ├── stop-words-tests.js └── stop-words.js ├── Chapter 07 ├── counter-metric.js ├── error-example.js ├── express-error.js ├── index.js ├── probe-metric.js ├── requests.sh └── simple-metric.js ├── Chapter 08 ├── dockerfile │ └── Dockerfile ├── example │ ├── error.js │ ├── node_modules │ │ └── express │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ ├── lib │ │ │ ├── application.js │ │ │ ├── express.js │ │ │ ├── middleware │ │ │ │ ├── init.js │ │ │ │ └── query.js │ │ │ ├── request.js │ │ │ ├── response.js │ │ │ ├── router │ │ │ │ ├── index.js │ │ │ │ ├── layer.js │ │ │ │ └── route.js │ │ │ ├── utils.js │ │ │ └── view.js │ │ │ ├── node_modules │ │ │ ├── accepts │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── mime-types │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── mime-db │ │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── db.json │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── package.json │ │ │ │ │ └── negotiator │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── charset.js │ │ │ │ │ │ ├── encoding.js │ │ │ │ │ │ ├── language.js │ │ │ │ │ │ └── mediaType.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── array-flatten │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── array-flatten.js │ │ │ │ └── package.json │ │ │ ├── content-disposition │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── content-type │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── cookie-signature │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── cookie │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── debug │ │ │ │ ├── .jshintrc │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── bower.json │ │ │ │ ├── browser.js │ │ │ │ ├── component.json │ │ │ │ ├── debug.js │ │ │ │ ├── node.js │ │ │ │ ├── node_modules │ │ │ │ │ └── ms │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── depd │ │ │ │ ├── History.md │ │ │ │ ├── LICENSE │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ ├── lib │ │ │ │ │ └── compat │ │ │ │ │ │ ├── buffer-concat.js │ │ │ │ │ │ ├── callsite-tostring.js │ │ │ │ │ │ └── index.js │ │ │ │ └── package.json │ │ │ ├── escape-html │ │ │ │ ├── LICENSE │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── etag │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── finalhandler │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ └── unpipe │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── fresh │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── merge-descriptors │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── methods │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── on-finished │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ └── ee-first │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── parseurl │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── path-to-regexp │ │ │ │ ├── History.md │ │ │ │ ├── LICENSE │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── proxy-addr │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── forwarded │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── ipaddr.js │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── Cakefile │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ ├── ipaddr.min.js │ │ │ │ │ │ ├── lib │ │ │ │ │ │ └── ipaddr.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ ├── src │ │ │ │ │ │ └── ipaddr.coffee │ │ │ │ │ │ └── test │ │ │ │ │ │ └── ipaddr.test.coffee │ │ │ │ └── package.json │ │ │ ├── qs │ │ │ │ ├── .eslintignore │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── bower.json │ │ │ │ ├── lib │ │ │ │ │ ├── index.js │ │ │ │ │ ├── parse.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── utils.js │ │ │ │ ├── package.json │ │ │ │ └── test │ │ │ │ │ ├── parse.js │ │ │ │ │ ├── stringify.js │ │ │ │ │ └── utils.js │ │ │ ├── range-parser │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── send │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── .bin │ │ │ │ │ │ └── mime │ │ │ │ │ ├── destroy │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── http-errors │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── inherits │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── inherits.js │ │ │ │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── mime │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── build │ │ │ │ │ │ │ ├── build.js │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ ├── cli.js │ │ │ │ │ │ ├── mime.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── types.json │ │ │ │ │ ├── ms │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── statuses │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── codes.json │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── serve-static │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── escape-html │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── send │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── .bin │ │ │ │ │ │ │ └── mime │ │ │ │ │ │ ├── depd │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── lib │ │ │ │ │ │ │ │ ├── browser │ │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ │ └── compat │ │ │ │ │ │ │ │ │ ├── buffer-concat.js │ │ │ │ │ │ │ │ │ ├── callsite-tostring.js │ │ │ │ │ │ │ │ │ ├── event-listener-count.js │ │ │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── destroy │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── http-errors │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ │ └── inherits │ │ │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ │ ├── inherits.js │ │ │ │ │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ ├── mime │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── build │ │ │ │ │ │ │ │ ├── build.js │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ ├── cli.js │ │ │ │ │ │ │ ├── mime.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ └── types.json │ │ │ │ │ │ ├── ms │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── statuses │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── codes.json │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── type-is │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── media-typer │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── mime-types │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── mime-db │ │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── db.json │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── utils-merge │ │ │ │ ├── .travis.yml │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ └── vary │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ └── package.json │ └── small-script.js ├── pm2-scale │ ├── app.js │ ├── ecosystem.json5 │ └── node_modules │ │ └── http │ │ └── package.json └── pm2 │ └── ecosystem.json5 └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Chapter 01/GeoIpService.java: -------------------------------------------------------------------------------- 1 | public interface GeoIpService { 2 | /** 3 | * Checks if an IP is in the country given by an ISO code. 4 | **/ 5 | boolean isIn(String ip, String isoCode) throws SOAPFaultException; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Chapter 01/PaymentService.java: -------------------------------------------------------------------------------- 1 | public interface PaymentService { 2 | PaymentResponse processPayment(PaymentRequest request) throws MyBusinessException; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /Chapter 01/aggregation.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.get('/sayhello', function (req, res) { 5 | res.send('Hello World!'); 6 | }); 7 | app.get('/saygoodbye', function(req, res) { 8 | res.send('Bye bye!'); 9 | } 10 | 11 | var server = app.listen(3000, function () { 12 | 13 | var host = server.address().address; 14 | var port = server.address().port; 15 | 16 | console.log('Example app listening at http://%s:%s', host, port); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /Chapter 02/add-integer-2.js: -------------------------------------------------------------------------------- 1 | var seneca = require( 'seneca' )() 2 | 3 | seneca.add({role: 'math', cmd: 'sum'}, function (msg, respond) { 4 | var sum = msg.left + msg.right 5 | respond(null, {answer: sum}) 6 | }); 7 | 8 | seneca.add({role: 'math', cmd: 'sum', integer: true}, function (msg, respond) { 9 | this.act({role: 'math', cmd: 'sum', left: Math.floor(msg.left), right: Math.floor(msg.right)},respond); 10 | }) 11 | 12 | seneca.act({role: 'math', cmd: 'sum', left: 1.5, right: 2.5}, console.log); 13 | seneca.act({role: 'math', cmd: 'sum', left: 1.5, right: 2.5, integer: true}, console.log); 14 | -------------------------------------------------------------------------------- /Chapter 02/data-storage.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')() 2 | 3 | var product = seneca.make('product') 4 | product.name = 'Apple' 5 | product.price = 1.99 6 | 7 | product.save$( console.log ) 8 | -------------------------------------------------------------------------------- /Chapter 02/employee-management-require.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')().use('employees-storage') 2 | 3 | var employee = { 4 | name: "David", 5 | surname: "Gonzalez", 6 | position: "Software Developer" 7 | } 8 | 9 | function add_employee() { 10 | seneca.act({role: 'employee', cmd: 'add', data: employee}, function (err, msg) { 11 | console.log(msg); 12 | }); 13 | } 14 | 15 | add_employee(); 16 | -------------------------------------------------------------------------------- /Chapter 02/employees-storage.js: -------------------------------------------------------------------------------- 1 | module.exports = function(options) { 2 | this.add({role: 'employee', cmd: 'add'}, function(msg, respond){ 3 | this.make('employee').data$(msg.data).save$(respond); 4 | }); 5 | 6 | this.find({role: 'employee', cmd: 'get'}, function(msg, respond) { 7 | this.make('employee').load$(msg.id, respond); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /Chapter 02/helloWorld.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | 3 | var server = http.createServer(function (request, response) { 4 | response.writeHead(200, {"Content-Type": "text/plain"}); 5 | response.end("Hello World\n"); 6 | }); 7 | 8 | server.listen(8000); 9 | 10 | console.log("Server running at http://127.0.0.1:8000/"); 11 | -------------------------------------------------------------------------------- /Chapter 02/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title of the document 6 | 9 | 10 | 11 | Hello Mundo 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter 02/minimal-plugin.js: -------------------------------------------------------------------------------- 1 | function minimal_plugin( options ) { 2 | console.log(options) 3 | } 4 | 5 | require( 'seneca' )() 6 | .use( minimal_plugin, {foo:'bar'} ) 7 | -------------------------------------------------------------------------------- /Chapter 02/seneca-fail.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')(); 2 | 3 | 4 | seneca.add({cmd: 'divide'}, function(msg, respond) { 5 | respond({'result': msg.a / msg.b }); 6 | }); 7 | 8 | seneca.listen(); 9 | 10 | seneca.act({cmd: 'divide', a: 10, b:1}, function(err, response) { 11 | console.log(err); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter 02/seneca-web.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')() 2 | 3 | seneca.add('role:api,cmd:bazinga',function(args,done){ 4 | done(null,{bar:"Bazinga!"}); 5 | }); 6 | 7 | seneca.act('role:web',{use:{ 8 | prefix: '/my-api', 9 | pin: {role:'api',cmd:'*'}, 10 | map:{ 11 | bazinga: {GET: true} 12 | } 13 | }}) 14 | 15 | var express = require('express') 16 | var app = express() 17 | 18 | app.use( seneca.export('web') ) 19 | 20 | app.listen(3000) 21 | -------------------------------------------------------------------------------- /Chapter 02/string-manipulation-restructured.js: -------------------------------------------------------------------------------- 1 | function init(options) { 2 | 3 | function charToNumber(char) { 4 | return char.charCodeAt(0) - 96; 5 | } 6 | 7 | function StringManipulation() { 8 | } 9 | 10 | var stringManipulation = new StringManipulation(); 11 | 12 | stringManipulation.contains = function(a, b) { 13 | return a.indexOf(b) > -1; 14 | }; 15 | 16 | stringManipulation.stringToOrdinal = function(str) { 17 | var result = "" 18 | for (var i = 0, len = str.length; i < len; i++) { 19 | result += charToNumber(str[i]); 20 | } 21 | return result; 22 | } 23 | return stringManipulation; 24 | } 25 | 26 | module.exports = init; 27 | -------------------------------------------------------------------------------- /Chapter 02/string-manipulation.js: -------------------------------------------------------------------------------- 1 | function contains(a, b) { 2 | return a.indexOf(b) > -1; 3 | } 4 | 5 | function stringToOrdinal(str) { 6 | var result = "" 7 | for (var i = 0, len = str.length; i < len; i++) { 8 | result += charToNumber(str[i]); 9 | } 10 | return result; 11 | } 12 | 13 | function charToNumber(char) { 14 | return char.charCodeAt(0) - 96; 15 | } 16 | 17 | module.exports = { 18 | contains: contains, 19 | stringToOrdinal: stringToOrdinal 20 | } 21 | -------------------------------------------------------------------------------- /Chapter 02/string-require.js: -------------------------------------------------------------------------------- 1 | var stringManipulation = require("./string-manipulation-restructured")(); 2 | 3 | console.log(stringManipulation.stringToOrdinal("aabb")); 4 | -------------------------------------------------------------------------------- /Chapter 02/sum-product-plugin.js: -------------------------------------------------------------------------------- 1 | function init(msg, respond) { 2 | console.log("plugin initialized!"); 3 | console.log("expensive operation taking place now... DONE!"); 4 | respond(); 5 | } 6 | 7 | function math( options ) { 8 | 9 | this.add({role:'math', cmd: 'sum'}, function( msg, respond ) { 10 | respond( null, { answer: msg.left + msg.right } ) 11 | }) 12 | 13 | this.add({role:'math', cmd: 'product'}, function( msg, respond ) { 14 | respond( null, { answer: msg.left * msg.right } ) 15 | }) 16 | 17 | this.add({init: "math"}, init); 18 | 19 | } 20 | 21 | require( 'seneca' )() 22 | .use( math ) 23 | .act( 'role:math,cmd:sum,left:1,right:2', console.log ) 24 | -------------------------------------------------------------------------------- /Chapter 03/monolyth/index.js: -------------------------------------------------------------------------------- 1 | var monolith = require('./monolyth')(); 2 | monolith.sendSMS(); 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/email.js: -------------------------------------------------------------------------------- 1 | module.exports = function (options) { 2 | 3 | /** 4 | * Sends an email. 5 | */ 6 | this.add({channel: 'email', action: 'send'}, function(msg, respond) { 7 | // Code to send an email. 8 | respond(null, {ok: "ok"}); 9 | }); 10 | 11 | /** 12 | * Gets a list of pending emails. 13 | */ 14 | this.add({channel: 'email', action: 'pending'}, function(msg, respond) { 15 | // Code to read pending email. 16 | respond(null, {ok: "ok"}); 17 | }); 18 | 19 | /** 20 | * Marks a message as read. 21 | */ 22 | this.add({channel: 'email', action: 'read'}, function(msg, respond) { 23 | // Code to mark a message as read. 24 | respond(null, {ok: "ok"}); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/index.js: -------------------------------------------------------------------------------- 1 | var seneca = require("seneca")() 2 | .use("email") 3 | .use("sms") 4 | .use("post"); 5 | 6 | seneca.listen({port: 1932, host: "10.0.0.7"}); 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/index2.js: -------------------------------------------------------------------------------- 1 | var seneca = require("seneca")() 2 | .use("email") 3 | .use("sms") 4 | .use("post"); 5 | seneca.listen({port: 1932, host: "10.0.0.7"}); 6 | 7 | // interact with the existing email service using "seneca" 8 | 9 | var senecaEmail = require("seneca").client({host: "new-email-service-ip", port: 1932}); 10 | 11 | // interact with the new email service using "senecaEmail" 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/archy/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/archy/examples/beep.js: -------------------------------------------------------------------------------- 1 | var archy = require('../'); 2 | var s = archy({ 3 | label : 'beep', 4 | nodes : [ 5 | 'ity', 6 | { 7 | label : 'boop', 8 | nodes : [ 9 | { 10 | label : 'o_O', 11 | nodes : [ 12 | { 13 | label : 'oh', 14 | nodes : [ 'hello', 'puny' ] 15 | }, 16 | 'human' 17 | ] 18 | }, 19 | 'party\ntime!' 20 | ] 21 | } 22 | ] 23 | }); 24 | console.log(s); 25 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/archy/examples/multi_line.js: -------------------------------------------------------------------------------- 1 | var archy = require('../'); 2 | 3 | var s = archy({ 4 | label : 'beep\none\ntwo', 5 | nodes : [ 6 | 'ity', 7 | { 8 | label : 'boop', 9 | nodes : [ 10 | { 11 | label : 'o_O\nwheee', 12 | nodes : [ 13 | { 14 | label : 'oh', 15 | nodes : [ 'hello', 'puny\nmeat' ] 16 | }, 17 | 'creature' 18 | ] 19 | }, 20 | 'party\ntime!' 21 | ] 22 | } 23 | ] 24 | }); 25 | console.log(s); 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | 27 | *~ 28 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "iojs" 4 | - "0.12" 5 | - "0.11" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/build.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "./node_modules/jshint" ]; then 2 | npm install jshint@2 3 | fi 4 | 5 | if [ ! -d "./node_modules/docco" ]; then 6 | npm install docco@0 7 | fi 8 | 9 | ./node_modules/.bin/jshint gate-executor.js 10 | ./node_modules/.bin/docco gate-executor.js -o doc 11 | cp -r doc/* ../gh-pages/gate-executor/doc 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/aller-light.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/novecento-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/doc/public/fonts/roboto-black.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/node_modules/async/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "iojs" 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/node_modules/async/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "async", 3 | "description": "Higher-order functions and common patterns for asynchronous code", 4 | "version": "0.9.2", 5 | "keywords": [ 6 | "async", 7 | "callback", 8 | "utility", 9 | "module" 10 | ], 11 | "license": "MIT", 12 | "repository": "caolan/async", 13 | "scripts": [ 14 | "lib/async.js" 15 | ] 16 | } -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/gate-executor/test.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "./node_modules/mocha" ]; then 2 | npm install mocha@1 3 | fi 4 | 5 | ./node_modules/.bin/mocha test/*.test.js 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/lru-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/lru-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # Authors, sorted by whether or not they are me 2 | Isaac Z. Schlueter 3 | Brian Cottingham 4 | Carlos Brito Lage 5 | Jesse Dailey 6 | Kevin O'Hara 7 | Marco Rogers 8 | Mark Cavage 9 | Marko Mikulicic 10 | Nathan Rajlich 11 | Satheesh Natesan 12 | Trent Mick 13 | ashleybrener 14 | n4kz 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/example/parse.js: -------------------------------------------------------------------------------- 1 | var argv = require('../')(process.argv.slice(2)); 2 | console.dir(argv); 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/test/dotted.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('dotted alias', function (t) { 5 | var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 6 | t.equal(argv.a.b, 22); 7 | t.equal(argv.aa.bb, 22); 8 | t.end(); 9 | }); 10 | 11 | test('dotted default', function (t) { 12 | var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); 13 | t.equal(argv.a.b, 11); 14 | t.equal(argv.aa.bb, 11); 15 | t.end(); 16 | }); 17 | 18 | test('dotted default with no alias', function (t) { 19 | var argv = parse('', {default: {'a.b': 11}}); 20 | t.equal(argv.a.b, 11); 21 | t.end(); 22 | }); 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/test/parse_modified.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('parse with modifier functions' , function (t) { 5 | t.plan(1); 6 | 7 | var argv = parse([ '-b', '123' ], { boolean: 'b' }); 8 | t.deepEqual(argv, { b: true, _: [123] }); 9 | }); 10 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/test/stop_early.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('stops parsing on the first non-option when stopEarly is set', function (t) { 5 | var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { 6 | stopEarly: true 7 | }); 8 | 9 | t.deepEqual(argv, { 10 | aaa: 'bbb', 11 | _: ['ccc', '--ddd'] 12 | }); 13 | 14 | t.end(); 15 | }); 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/minimist/test/whitespace.js: -------------------------------------------------------------------------------- 1 | var parse = require('../'); 2 | var test = require('tape'); 3 | 4 | test('whitespace should be whitespace' , function (t) { 5 | t.plan(1); 6 | var x = parse([ '-x', '\t' ]).x; 7 | t.equal(x, '\t'); 8 | }); 9 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | node_modules 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | - "0.10" 5 | - "0.8" 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/build.sh: -------------------------------------------------------------------------------- 1 | ./node_modules/.bin/pegjs norma-parser.pegjs 2 | ./node_modules/.bin/uglifyjs norma.js -c "evaluate=false" --comments "/ Copyright .*/" -m --source-map norma-min.map -o norma-min.js 3 | ./node_modules/.bin/jshint norma.js 4 | ./node_modules/.bin/docco norma.js -o doc 5 | cp -r doc/* ../gh-pages/norma/doc 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/aller-light.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/doc/public/fonts/novecento-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/norma/test.sh: -------------------------------------------------------------------------------- 1 | ./node_modules/.bin/mocha test/*.test.js 2 | node test/readme.js 3 | 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/first.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Gets the first element of `array`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @alias head 7 | * @category Array 8 | * @param {Array} array The array to query. 9 | * @returns {*} Returns the first element of `array`. 10 | * @example 11 | * 12 | * _.first([1, 2, 3]); 13 | * // => 1 14 | * 15 | * _.first([]); 16 | * // => undefined 17 | */ 18 | function first(array) { 19 | return array ? array[0] : undefined; 20 | } 21 | 22 | module.exports = first; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/flattenDeep.js: -------------------------------------------------------------------------------- 1 | var baseFlatten = require('../internal/baseFlatten'); 2 | 3 | /** 4 | * Recursively flattens a nested array. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category Array 9 | * @param {Array} array The array to recursively flatten. 10 | * @returns {Array} Returns the new flattened array. 11 | * @example 12 | * 13 | * _.flattenDeep([1, [2, 3, [4]]]); 14 | * // => [1, 2, 3, 4] 15 | */ 16 | function flattenDeep(array) { 17 | var length = array ? array.length : 0; 18 | return length ? baseFlatten(array, true) : []; 19 | } 20 | 21 | module.exports = flattenDeep; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/head.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./first'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/initial.js: -------------------------------------------------------------------------------- 1 | var dropRight = require('./dropRight'); 2 | 3 | /** 4 | * Gets all but the last element of `array`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category Array 9 | * @param {Array} array The array to query. 10 | * @returns {Array} Returns the slice of `array`. 11 | * @example 12 | * 13 | * _.initial([1, 2, 3]); 14 | * // => [1, 2] 15 | */ 16 | function initial(array) { 17 | return dropRight(array, 1); 18 | } 19 | 20 | module.exports = initial; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/last.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Gets the last element of `array`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Array 7 | * @param {Array} array The array to query. 8 | * @returns {*} Returns the last element of `array`. 9 | * @example 10 | * 11 | * _.last([1, 2, 3]); 12 | * // => 3 13 | */ 14 | function last(array) { 15 | var length = array ? array.length : 0; 16 | return length ? array[length - 1] : undefined; 17 | } 18 | 19 | module.exports = last; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/object.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./zipObject'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/rest.js: -------------------------------------------------------------------------------- 1 | var drop = require('./drop'); 2 | 3 | /** 4 | * Gets all but the first element of `array`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @alias tail 9 | * @category Array 10 | * @param {Array} array The array to query. 11 | * @returns {Array} Returns the slice of `array`. 12 | * @example 13 | * 14 | * _.rest([1, 2, 3]); 15 | * // => [2, 3] 16 | */ 17 | function rest(array) { 18 | return drop(array, 1); 19 | } 20 | 21 | module.exports = rest; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/tail.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./rest'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/array/unique.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./uniq'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'chain': require('./chain/chain'), 3 | 'commit': require('./chain/commit'), 4 | 'concat': require('./chain/concat'), 5 | 'lodash': require('./chain/lodash'), 6 | 'plant': require('./chain/plant'), 7 | 'reverse': require('./chain/reverse'), 8 | 'run': require('./chain/run'), 9 | 'tap': require('./chain/tap'), 10 | 'thru': require('./chain/thru'), 11 | 'toJSON': require('./chain/toJSON'), 12 | 'toString': require('./chain/toString'), 13 | 'value': require('./chain/value'), 14 | 'valueOf': require('./chain/valueOf'), 15 | 'wrapperChain': require('./chain/wrapperChain') 16 | }; 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/commit.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperCommit'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/concat.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperConcat'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/plant.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperPlant'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/reverse.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperReverse'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/run.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperValue'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/toJSON.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperValue'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/toString.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperToString'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/value.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperValue'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/valueOf.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./wrapperValue'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/wrapperToString.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Produces the result of coercing the unwrapped value to a string. 3 | * 4 | * @name toString 5 | * @memberOf _ 6 | * @category Chain 7 | * @returns {string} Returns the coerced string value. 8 | * @example 9 | * 10 | * _([1, 2, 3]).toString(); 11 | * // => '1,2,3' 12 | */ 13 | function wrapperToString() { 14 | return (this.value() + ''); 15 | } 16 | 17 | module.exports = wrapperToString; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/chain/wrapperValue.js: -------------------------------------------------------------------------------- 1 | var baseWrapperValue = require('../internal/baseWrapperValue'); 2 | 3 | /** 4 | * Executes the chained sequence to extract the unwrapped value. 5 | * 6 | * @name value 7 | * @memberOf _ 8 | * @alias run, toJSON, valueOf 9 | * @category Chain 10 | * @returns {*} Returns the resolved unwrapped value. 11 | * @example 12 | * 13 | * _([1, 2, 3]).value(); 14 | * // => [1, 2, 3] 15 | */ 16 | function wrapperValue() { 17 | return baseWrapperValue(this.__wrapped__, this.__actions__); 18 | } 19 | 20 | module.exports = wrapperValue; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/all.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./every'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/any.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./some'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/collect.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./map'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/contains.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./includes'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/detect.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./find'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/each.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./forEach'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/eachRight.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./forEachRight'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/foldl.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./reduce'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/foldr.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./reduceRight'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/include.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./includes'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/inject.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./reduce'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/max.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../math/max'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/min.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../math/min'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/select.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./filter'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/collection/sum.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../math/sum'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/date.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'now': require('./date/now') 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/function/backflow.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./flowRight'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/function/compose.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./flowRight'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/function/flowRight.js: -------------------------------------------------------------------------------- 1 | var createFlow = require('../internal/createFlow'); 2 | 3 | /** 4 | * This method is like `_.flow` except that it creates a function that 5 | * invokes the provided functions from right to left. 6 | * 7 | * @static 8 | * @memberOf _ 9 | * @alias backflow, compose 10 | * @category Function 11 | * @param {...Function} [funcs] Functions to invoke. 12 | * @returns {Function} Returns the new function. 13 | * @example 14 | * 15 | * function square(n) { 16 | * return n * n; 17 | * } 18 | * 19 | * var addSquare = _.flowRight(square, _.add); 20 | * addSquare(1, 2); 21 | * // => 9 22 | */ 23 | var flowRight = createFlow(true); 24 | 25 | module.exports = flowRight; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/MapCache.js: -------------------------------------------------------------------------------- 1 | var mapDelete = require('./mapDelete'), 2 | mapGet = require('./mapGet'), 3 | mapHas = require('./mapHas'), 4 | mapSet = require('./mapSet'); 5 | 6 | /** 7 | * Creates a cache object to store key/value pairs. 8 | * 9 | * @private 10 | * @static 11 | * @name Cache 12 | * @memberOf _.memoize 13 | */ 14 | function MapCache() { 15 | this.__data__ = {}; 16 | } 17 | 18 | // Add functions to the `Map` cache. 19 | MapCache.prototype['delete'] = mapDelete; 20 | MapCache.prototype.get = mapGet; 21 | MapCache.prototype.has = mapHas; 22 | MapCache.prototype.set = mapSet; 23 | 24 | module.exports = MapCache; 25 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayCopy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copies the values of `source` to `array`. 3 | * 4 | * @private 5 | * @param {Array} source The array to copy values from. 6 | * @param {Array} [array=[]] The array to copy values to. 7 | * @returns {Array} Returns `array`. 8 | */ 9 | function arrayCopy(source, array) { 10 | var index = -1, 11 | length = source.length; 12 | 13 | array || (array = Array(length)); 14 | while (++index < length) { 15 | array[index] = source[index]; 16 | } 17 | return array; 18 | } 19 | 20 | module.exports = arrayCopy; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayEach.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.forEach` for arrays without support for callback 3 | * shorthands and `this` binding. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} iteratee The function invoked per iteration. 8 | * @returns {Array} Returns `array`. 9 | */ 10 | function arrayEach(array, iteratee) { 11 | var index = -1, 12 | length = array.length; 13 | 14 | while (++index < length) { 15 | if (iteratee(array[index], index, array) === false) { 16 | break; 17 | } 18 | } 19 | return array; 20 | } 21 | 22 | module.exports = arrayEach; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayEachRight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.forEachRight` for arrays without support for 3 | * callback shorthands and `this` binding. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} iteratee The function invoked per iteration. 8 | * @returns {Array} Returns `array`. 9 | */ 10 | function arrayEachRight(array, iteratee) { 11 | var length = array.length; 12 | 13 | while (length--) { 14 | if (iteratee(array[length], length, array) === false) { 15 | break; 16 | } 17 | } 18 | return array; 19 | } 20 | 21 | module.exports = arrayEachRight; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayEvery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.every` for arrays without support for callback 3 | * shorthands and `this` binding. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} predicate The function invoked per iteration. 8 | * @returns {boolean} Returns `true` if all elements pass the predicate check, 9 | * else `false`. 10 | */ 11 | function arrayEvery(array, predicate) { 12 | var index = -1, 13 | length = array.length; 14 | 15 | while (++index < length) { 16 | if (!predicate(array[index], index, array)) { 17 | return false; 18 | } 19 | } 20 | return true; 21 | } 22 | 23 | module.exports = arrayEvery; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayMap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.map` for arrays without support for callback 3 | * shorthands and `this` binding. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} iteratee The function invoked per iteration. 8 | * @returns {Array} Returns the new mapped array. 9 | */ 10 | function arrayMap(array, iteratee) { 11 | var index = -1, 12 | length = array.length, 13 | result = Array(length); 14 | 15 | while (++index < length) { 16 | result[index] = iteratee(array[index], index, array); 17 | } 18 | return result; 19 | } 20 | 21 | module.exports = arrayMap; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arrayPush.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Appends the elements of `values` to `array`. 3 | * 4 | * @private 5 | * @param {Array} array The array to modify. 6 | * @param {Array} values The values to append. 7 | * @returns {Array} Returns `array`. 8 | */ 9 | function arrayPush(array, values) { 10 | var index = -1, 11 | length = values.length, 12 | offset = array.length; 13 | 14 | while (++index < length) { 15 | array[offset + index] = values[index]; 16 | } 17 | return array; 18 | } 19 | 20 | module.exports = arrayPush; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arraySome.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.some` for arrays without support for callback 3 | * shorthands and `this` binding. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} predicate The function invoked per iteration. 8 | * @returns {boolean} Returns `true` if any element passes the predicate check, 9 | * else `false`. 10 | */ 11 | function arraySome(array, predicate) { 12 | var index = -1, 13 | length = array.length; 14 | 15 | while (++index < length) { 16 | if (predicate(array[index], index, array)) { 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | 23 | module.exports = arraySome; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/arraySum.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A specialized version of `_.sum` for arrays without support for callback 3 | * shorthands and `this` binding.. 4 | * 5 | * @private 6 | * @param {Array} array The array to iterate over. 7 | * @param {Function} iteratee The function invoked per iteration. 8 | * @returns {number} Returns the sum. 9 | */ 10 | function arraySum(array, iteratee) { 11 | var length = array.length, 12 | result = 0; 13 | 14 | while (length--) { 15 | result += +iteratee(array[length]) || 0; 16 | } 17 | return result; 18 | } 19 | 20 | module.exports = arraySum; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/assignDefaults.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used by `_.defaults` to customize its `_.assign` use. 3 | * 4 | * @private 5 | * @param {*} objectValue The destination object property value. 6 | * @param {*} sourceValue The source object property value. 7 | * @returns {*} Returns the value to assign to the destination object. 8 | */ 9 | function assignDefaults(objectValue, sourceValue) { 10 | return objectValue === undefined ? sourceValue : objectValue; 11 | } 12 | 13 | module.exports = assignDefaults; 14 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseAssign.js: -------------------------------------------------------------------------------- 1 | var baseCopy = require('./baseCopy'), 2 | keys = require('../object/keys'); 3 | 4 | /** 5 | * The base implementation of `_.assign` without support for argument juggling, 6 | * multiple sources, and `customizer` functions. 7 | * 8 | * @private 9 | * @param {Object} object The destination object. 10 | * @param {Object} source The source object. 11 | * @returns {Object} Returns `object`. 12 | */ 13 | function baseAssign(object, source) { 14 | return source == null 15 | ? object 16 | : baseCopy(source, keys(source), object); 17 | } 18 | 19 | module.exports = baseAssign; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseCopy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copies properties of `source` to `object`. 3 | * 4 | * @private 5 | * @param {Object} source The object to copy properties from. 6 | * @param {Array} props The property names to copy. 7 | * @param {Object} [object={}] The object to copy properties to. 8 | * @returns {Object} Returns `object`. 9 | */ 10 | function baseCopy(source, props, object) { 11 | object || (object = {}); 12 | 13 | var index = -1, 14 | length = props.length; 15 | 16 | while (++index < length) { 17 | var key = props[index]; 18 | object[key] = source[key]; 19 | } 20 | return object; 21 | } 22 | 23 | module.exports = baseCopy; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseCreate.js: -------------------------------------------------------------------------------- 1 | var isObject = require('../lang/isObject'); 2 | 3 | /** 4 | * The base implementation of `_.create` without support for assigning 5 | * properties to the created object. 6 | * 7 | * @private 8 | * @param {Object} prototype The object to inherit from. 9 | * @returns {Object} Returns the new object. 10 | */ 11 | var baseCreate = (function() { 12 | function object() {} 13 | return function(prototype) { 14 | if (isObject(prototype)) { 15 | object.prototype = prototype; 16 | var result = new object; 17 | object.prototype = undefined; 18 | } 19 | return result || {}; 20 | }; 21 | }()); 22 | 23 | module.exports = baseCreate; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseEach.js: -------------------------------------------------------------------------------- 1 | var baseForOwn = require('./baseForOwn'), 2 | createBaseEach = require('./createBaseEach'); 3 | 4 | /** 5 | * The base implementation of `_.forEach` without support for callback 6 | * shorthands and `this` binding. 7 | * 8 | * @private 9 | * @param {Array|Object|string} collection The collection to iterate over. 10 | * @param {Function} iteratee The function invoked per iteration. 11 | * @returns {Array|Object|string} Returns `collection`. 12 | */ 13 | var baseEach = createBaseEach(baseForOwn); 14 | 15 | module.exports = baseEach; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseEachRight.js: -------------------------------------------------------------------------------- 1 | var baseForOwnRight = require('./baseForOwnRight'), 2 | createBaseEach = require('./createBaseEach'); 3 | 4 | /** 5 | * The base implementation of `_.forEachRight` without support for callback 6 | * shorthands and `this` binding. 7 | * 8 | * @private 9 | * @param {Array|Object|string} collection The collection to iterate over. 10 | * @param {Function} iteratee The function invoked per iteration. 11 | * @returns {Array|Object|string} Returns `collection`. 12 | */ 13 | var baseEachRight = createBaseEach(baseForOwnRight, true); 14 | 15 | module.exports = baseEachRight; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseFor.js: -------------------------------------------------------------------------------- 1 | var createBaseFor = require('./createBaseFor'); 2 | 3 | /** 4 | * The base implementation of `baseForIn` and `baseForOwn` which iterates 5 | * over `object` properties returned by `keysFunc` invoking `iteratee` for 6 | * each property. Iteratee functions may exit iteration early by explicitly 7 | * returning `false`. 8 | * 9 | * @private 10 | * @param {Object} object The object to iterate over. 11 | * @param {Function} iteratee The function invoked per iteration. 12 | * @param {Function} keysFunc The function to get the keys of `object`. 13 | * @returns {Object} Returns `object`. 14 | */ 15 | var baseFor = createBaseFor(); 16 | 17 | module.exports = baseFor; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseForIn.js: -------------------------------------------------------------------------------- 1 | var baseFor = require('./baseFor'), 2 | keysIn = require('../object/keysIn'); 3 | 4 | /** 5 | * The base implementation of `_.forIn` without support for callback 6 | * shorthands and `this` binding. 7 | * 8 | * @private 9 | * @param {Object} object The object to iterate over. 10 | * @param {Function} iteratee The function invoked per iteration. 11 | * @returns {Object} Returns `object`. 12 | */ 13 | function baseForIn(object, iteratee) { 14 | return baseFor(object, iteratee, keysIn); 15 | } 16 | 17 | module.exports = baseForIn; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseForOwn.js: -------------------------------------------------------------------------------- 1 | var baseFor = require('./baseFor'), 2 | keys = require('../object/keys'); 3 | 4 | /** 5 | * The base implementation of `_.forOwn` without support for callback 6 | * shorthands and `this` binding. 7 | * 8 | * @private 9 | * @param {Object} object The object to iterate over. 10 | * @param {Function} iteratee The function invoked per iteration. 11 | * @returns {Object} Returns `object`. 12 | */ 13 | function baseForOwn(object, iteratee) { 14 | return baseFor(object, iteratee, keys); 15 | } 16 | 17 | module.exports = baseForOwn; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseForOwnRight.js: -------------------------------------------------------------------------------- 1 | var baseForRight = require('./baseForRight'), 2 | keys = require('../object/keys'); 3 | 4 | /** 5 | * The base implementation of `_.forOwnRight` without support for callback 6 | * shorthands and `this` binding. 7 | * 8 | * @private 9 | * @param {Object} object The object to iterate over. 10 | * @param {Function} iteratee The function invoked per iteration. 11 | * @returns {Object} Returns `object`. 12 | */ 13 | function baseForOwnRight(object, iteratee) { 14 | return baseForRight(object, iteratee, keys); 15 | } 16 | 17 | module.exports = baseForOwnRight; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseForRight.js: -------------------------------------------------------------------------------- 1 | var createBaseFor = require('./createBaseFor'); 2 | 3 | /** 4 | * This function is like `baseFor` except that it iterates over properties 5 | * in the opposite order. 6 | * 7 | * @private 8 | * @param {Object} object The object to iterate over. 9 | * @param {Function} iteratee The function invoked per iteration. 10 | * @param {Function} keysFunc The function to get the keys of `object`. 11 | * @returns {Object} Returns `object`. 12 | */ 13 | var baseForRight = createBaseFor(true); 14 | 15 | module.exports = baseForRight; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseIsFunction.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The base implementation of `_.isFunction` without support for environments 3 | * with incorrect `typeof` results. 4 | * 5 | * @private 6 | * @param {*} value The value to check. 7 | * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 8 | */ 9 | function baseIsFunction(value) { 10 | // Avoid a Chakra JIT bug in compatibility modes of IE 11. 11 | // See https://github.com/jashkenas/underscore/issues/1621 for more details. 12 | return typeof value == 'function' || false; 13 | } 14 | 15 | module.exports = baseIsFunction; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseLodash.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The function whose prototype all chaining wrappers inherit from. 3 | * 4 | * @private 5 | */ 6 | function baseLodash() { 7 | // No operation performed. 8 | } 9 | 10 | module.exports = baseLodash; 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseProperty.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The base implementation of `_.property` without support for deep paths. 3 | * 4 | * @private 5 | * @param {string} key The key of the property to get. 6 | * @returns {Function} Returns the new function. 7 | */ 8 | function baseProperty(key) { 9 | return function(object) { 10 | return object == null ? undefined : object[key]; 11 | }; 12 | } 13 | 14 | module.exports = baseProperty; 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/basePropertyDeep.js: -------------------------------------------------------------------------------- 1 | var baseGet = require('./baseGet'), 2 | toPath = require('./toPath'); 3 | 4 | /** 5 | * A specialized version of `baseProperty` which supports deep paths. 6 | * 7 | * @private 8 | * @param {Array|string} path The path of the property to get. 9 | * @returns {Function} Returns the new function. 10 | */ 11 | function basePropertyDeep(path) { 12 | var pathKey = (path + ''); 13 | path = toPath(path); 14 | return function(object) { 15 | return baseGet(object, path, pathKey); 16 | }; 17 | } 18 | 19 | module.exports = basePropertyDeep; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseRandom.js: -------------------------------------------------------------------------------- 1 | /* Native method references for those with the same name as other `lodash` methods. */ 2 | var nativeFloor = Math.floor, 3 | nativeRandom = Math.random; 4 | 5 | /** 6 | * The base implementation of `_.random` without support for argument juggling 7 | * and returning floating-point numbers. 8 | * 9 | * @private 10 | * @param {number} min The minimum possible value. 11 | * @param {number} max The maximum possible value. 12 | * @returns {number} Returns the random number. 13 | */ 14 | function baseRandom(min, max) { 15 | return min + nativeFloor(nativeRandom() * (max - min + 1)); 16 | } 17 | 18 | module.exports = baseRandom; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseSetData.js: -------------------------------------------------------------------------------- 1 | var identity = require('../utility/identity'), 2 | metaMap = require('./metaMap'); 3 | 4 | /** 5 | * The base implementation of `setData` without support for hot loop detection. 6 | * 7 | * @private 8 | * @param {Function} func The function to associate metadata with. 9 | * @param {*} data The metadata. 10 | * @returns {Function} Returns `func`. 11 | */ 12 | var baseSetData = !metaMap ? identity : function(func, data) { 13 | metaMap.set(func, data); 14 | return func; 15 | }; 16 | 17 | module.exports = baseSetData; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseSortBy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The base implementation of `_.sortBy` which uses `comparer` to define 3 | * the sort order of `array` and replaces criteria objects with their 4 | * corresponding values. 5 | * 6 | * @private 7 | * @param {Array} array The array to sort. 8 | * @param {Function} comparer The function to define sort order. 9 | * @returns {Array} Returns `array`. 10 | */ 11 | function baseSortBy(array, comparer) { 12 | var length = array.length; 13 | 14 | array.sort(comparer); 15 | while (length--) { 16 | array[length] = array[length].value; 17 | } 18 | return array; 19 | } 20 | 21 | module.exports = baseSortBy; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseSum.js: -------------------------------------------------------------------------------- 1 | var baseEach = require('./baseEach'); 2 | 3 | /** 4 | * The base implementation of `_.sum` without support for callback shorthands 5 | * and `this` binding. 6 | * 7 | * @private 8 | * @param {Array|Object|string} collection The collection to iterate over. 9 | * @param {Function} iteratee The function invoked per iteration. 10 | * @returns {number} Returns the sum. 11 | */ 12 | function baseSum(collection, iteratee) { 13 | var result = 0; 14 | baseEach(collection, function(value, index, collection) { 15 | result += +iteratee(value, index, collection) || 0; 16 | }); 17 | return result; 18 | } 19 | 20 | module.exports = baseSum; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseToString.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Converts `value` to a string if it's not one. An empty string is returned 3 | * for `null` or `undefined` values. 4 | * 5 | * @private 6 | * @param {*} value The value to process. 7 | * @returns {string} Returns the string. 8 | */ 9 | function baseToString(value) { 10 | return value == null ? '' : (value + ''); 11 | } 12 | 13 | module.exports = baseToString; 14 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/baseValues.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The base implementation of `_.values` and `_.valuesIn` which creates an 3 | * array of `object` property values corresponding to the property names 4 | * of `props`. 5 | * 6 | * @private 7 | * @param {Object} object The object to query. 8 | * @param {Array} props The property names to get values for. 9 | * @returns {Object} Returns the array of property values. 10 | */ 11 | function baseValues(object, props) { 12 | var index = -1, 13 | length = props.length, 14 | result = Array(length); 15 | 16 | while (++index < length) { 17 | result[index] = object[props[index]]; 18 | } 19 | return result; 20 | } 21 | 22 | module.exports = baseValues; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/bufferClone.js: -------------------------------------------------------------------------------- 1 | /** Native method references. */ 2 | var ArrayBuffer = global.ArrayBuffer, 3 | Uint8Array = global.Uint8Array; 4 | 5 | /** 6 | * Creates a clone of the given array buffer. 7 | * 8 | * @private 9 | * @param {ArrayBuffer} buffer The array buffer to clone. 10 | * @returns {ArrayBuffer} Returns the cloned array buffer. 11 | */ 12 | function bufferClone(buffer) { 13 | var result = new ArrayBuffer(buffer.byteLength), 14 | view = new Uint8Array(result); 15 | 16 | view.set(new Uint8Array(buffer)); 17 | return result; 18 | } 19 | 20 | module.exports = bufferClone; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/cacheIndexOf.js: -------------------------------------------------------------------------------- 1 | var isObject = require('../lang/isObject'); 2 | 3 | /** 4 | * Checks if `value` is in `cache` mimicking the return signature of 5 | * `_.indexOf` by returning `0` if the value is found, else `-1`. 6 | * 7 | * @private 8 | * @param {Object} cache The cache to search. 9 | * @param {*} value The value to search for. 10 | * @returns {number} Returns `0` if `value` is found, else `-1`. 11 | */ 12 | function cacheIndexOf(cache, value) { 13 | var data = cache.data, 14 | result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; 15 | 16 | return result ? 0 : -1; 17 | } 18 | 19 | module.exports = cacheIndexOf; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/cachePush.js: -------------------------------------------------------------------------------- 1 | var isObject = require('../lang/isObject'); 2 | 3 | /** 4 | * Adds `value` to the cache. 5 | * 6 | * @private 7 | * @name push 8 | * @memberOf SetCache 9 | * @param {*} value The value to cache. 10 | */ 11 | function cachePush(value) { 12 | var data = this.data; 13 | if (typeof value == 'string' || isObject(value)) { 14 | data.set.add(value); 15 | } else { 16 | data.hash[value] = true; 17 | } 18 | } 19 | 20 | module.exports = cachePush; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/charsLeftIndex.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used by `_.trim` and `_.trimLeft` to get the index of the first character 3 | * of `string` that is not found in `chars`. 4 | * 5 | * @private 6 | * @param {string} string The string to inspect. 7 | * @param {string} chars The characters to find. 8 | * @returns {number} Returns the index of the first character not found in `chars`. 9 | */ 10 | function charsLeftIndex(string, chars) { 11 | var index = -1, 12 | length = string.length; 13 | 14 | while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} 15 | return index; 16 | } 17 | 18 | module.exports = charsLeftIndex; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/charsRightIndex.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used by `_.trim` and `_.trimRight` to get the index of the last character 3 | * of `string` that is not found in `chars`. 4 | * 5 | * @private 6 | * @param {string} string The string to inspect. 7 | * @param {string} chars The characters to find. 8 | * @returns {number} Returns the index of the last character not found in `chars`. 9 | */ 10 | function charsRightIndex(string, chars) { 11 | var index = string.length; 12 | 13 | while (index-- && chars.indexOf(string.charAt(index)) > -1) {} 14 | return index; 15 | } 16 | 17 | module.exports = charsRightIndex; 18 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/compareAscending.js: -------------------------------------------------------------------------------- 1 | var baseCompareAscending = require('./baseCompareAscending'); 2 | 3 | /** 4 | * Used by `_.sortBy` to compare transformed elements of a collection and stable 5 | * sort them in ascending order. 6 | * 7 | * @private 8 | * @param {Object} object The object to compare. 9 | * @param {Object} other The other object to compare. 10 | * @returns {number} Returns the sort order indicator for `object`. 11 | */ 12 | function compareAscending(object, other) { 13 | return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); 14 | } 15 | 16 | module.exports = compareAscending; 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createDefaults.js: -------------------------------------------------------------------------------- 1 | var restParam = require('../function/restParam'); 2 | 3 | /** 4 | * Creates a `_.defaults` or `_.defaultsDeep` function. 5 | * 6 | * @private 7 | * @param {Function} assigner The function to assign values. 8 | * @param {Function} customizer The function to customize assigned values. 9 | * @returns {Function} Returns the new defaults function. 10 | */ 11 | function createDefaults(assigner, customizer) { 12 | return restParam(function(args) { 13 | var object = args[0]; 14 | if (object == null) { 15 | return object; 16 | } 17 | args.push(customizer); 18 | return assigner.apply(undefined, args); 19 | }); 20 | } 21 | 22 | module.exports = createDefaults; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createFindIndex.js: -------------------------------------------------------------------------------- 1 | var baseCallback = require('./baseCallback'), 2 | baseFindIndex = require('./baseFindIndex'); 3 | 4 | /** 5 | * Creates a `_.findIndex` or `_.findLastIndex` function. 6 | * 7 | * @private 8 | * @param {boolean} [fromRight] Specify iterating from right to left. 9 | * @returns {Function} Returns the new find function. 10 | */ 11 | function createFindIndex(fromRight) { 12 | return function(array, predicate, thisArg) { 13 | if (!(array && array.length)) { 14 | return -1; 15 | } 16 | predicate = baseCallback(predicate, thisArg, 3); 17 | return baseFindIndex(array, predicate, fromRight); 18 | }; 19 | } 20 | 21 | module.exports = createFindIndex; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createFindKey.js: -------------------------------------------------------------------------------- 1 | var baseCallback = require('./baseCallback'), 2 | baseFind = require('./baseFind'); 3 | 4 | /** 5 | * Creates a `_.findKey` or `_.findLastKey` function. 6 | * 7 | * @private 8 | * @param {Function} objectFunc The function to iterate over an object. 9 | * @returns {Function} Returns the new find function. 10 | */ 11 | function createFindKey(objectFunc) { 12 | return function(object, predicate, thisArg) { 13 | predicate = baseCallback(predicate, thisArg, 3); 14 | return baseFind(object, predicate, objectFunc, true); 15 | }; 16 | } 17 | 18 | module.exports = createFindKey; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createForIn.js: -------------------------------------------------------------------------------- 1 | var bindCallback = require('./bindCallback'), 2 | keysIn = require('../object/keysIn'); 3 | 4 | /** 5 | * Creates a function for `_.forIn` or `_.forInRight`. 6 | * 7 | * @private 8 | * @param {Function} objectFunc The function to iterate over an object. 9 | * @returns {Function} Returns the new each function. 10 | */ 11 | function createForIn(objectFunc) { 12 | return function(object, iteratee, thisArg) { 13 | if (typeof iteratee != 'function' || thisArg !== undefined) { 14 | iteratee = bindCallback(iteratee, thisArg, 3); 15 | } 16 | return objectFunc(object, iteratee, keysIn); 17 | }; 18 | } 19 | 20 | module.exports = createForIn; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createForOwn.js: -------------------------------------------------------------------------------- 1 | var bindCallback = require('./bindCallback'); 2 | 3 | /** 4 | * Creates a function for `_.forOwn` or `_.forOwnRight`. 5 | * 6 | * @private 7 | * @param {Function} objectFunc The function to iterate over an object. 8 | * @returns {Function} Returns the new each function. 9 | */ 10 | function createForOwn(objectFunc) { 11 | return function(object, iteratee, thisArg) { 12 | if (typeof iteratee != 'function' || thisArg !== undefined) { 13 | iteratee = bindCallback(iteratee, thisArg, 3); 14 | } 15 | return objectFunc(object, iteratee); 16 | }; 17 | } 18 | 19 | module.exports = createForOwn; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/createPadDir.js: -------------------------------------------------------------------------------- 1 | var baseToString = require('./baseToString'), 2 | createPadding = require('./createPadding'); 3 | 4 | /** 5 | * Creates a function for `_.padLeft` or `_.padRight`. 6 | * 7 | * @private 8 | * @param {boolean} [fromRight] Specify padding from the right. 9 | * @returns {Function} Returns the new pad function. 10 | */ 11 | function createPadDir(fromRight) { 12 | return function(string, length, chars) { 13 | string = baseToString(string); 14 | return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); 15 | }; 16 | } 17 | 18 | module.exports = createPadDir; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/escapeHtmlChar.js: -------------------------------------------------------------------------------- 1 | /** Used to map characters to HTML entities. */ 2 | var htmlEscapes = { 3 | '&': '&', 4 | '<': '<', 5 | '>': '>', 6 | '"': '"', 7 | "'": ''', 8 | '`': '`' 9 | }; 10 | 11 | /** 12 | * Used by `_.escape` to convert characters to HTML entities. 13 | * 14 | * @private 15 | * @param {string} chr The matched character to escape. 16 | * @returns {string} Returns the escaped character. 17 | */ 18 | function escapeHtmlChar(chr) { 19 | return htmlEscapes[chr]; 20 | } 21 | 22 | module.exports = escapeHtmlChar; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/escapeStringChar.js: -------------------------------------------------------------------------------- 1 | /** Used to escape characters for inclusion in compiled string literals. */ 2 | var stringEscapes = { 3 | '\\': '\\', 4 | "'": "'", 5 | '\n': 'n', 6 | '\r': 'r', 7 | '\u2028': 'u2028', 8 | '\u2029': 'u2029' 9 | }; 10 | 11 | /** 12 | * Used by `_.template` to escape characters for inclusion in compiled string literals. 13 | * 14 | * @private 15 | * @param {string} chr The matched character to escape. 16 | * @returns {string} Returns the escaped character. 17 | */ 18 | function escapeStringChar(chr) { 19 | return '\\' + stringEscapes[chr]; 20 | } 21 | 22 | module.exports = escapeStringChar; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/getData.js: -------------------------------------------------------------------------------- 1 | var metaMap = require('./metaMap'), 2 | noop = require('../utility/noop'); 3 | 4 | /** 5 | * Gets metadata for `func`. 6 | * 7 | * @private 8 | * @param {Function} func The function to query. 9 | * @returns {*} Returns the metadata for `func`. 10 | */ 11 | var getData = !metaMap ? noop : function(func) { 12 | return metaMap.get(func); 13 | }; 14 | 15 | module.exports = getData; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/getFuncName.js: -------------------------------------------------------------------------------- 1 | var realNames = require('./realNames'); 2 | 3 | /** 4 | * Gets the name of `func`. 5 | * 6 | * @private 7 | * @param {Function} func The function to query. 8 | * @returns {string} Returns the function name. 9 | */ 10 | function getFuncName(func) { 11 | var result = func.name, 12 | array = realNames[result], 13 | length = array ? array.length : 0; 14 | 15 | while (length--) { 16 | var data = array[length], 17 | otherFunc = data.func; 18 | if (otherFunc == null || otherFunc == func) { 19 | return data.name; 20 | } 21 | } 22 | return result; 23 | } 24 | 25 | module.exports = getFuncName; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/getLength.js: -------------------------------------------------------------------------------- 1 | var baseProperty = require('./baseProperty'); 2 | 3 | /** 4 | * Gets the "length" property value of `object`. 5 | * 6 | * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 7 | * that affects Safari on at least iOS 8.1-8.3 ARM64. 8 | * 9 | * @private 10 | * @param {Object} object The object to query. 11 | * @returns {*} Returns the "length" value. 12 | */ 13 | var getLength = baseProperty('length'); 14 | 15 | module.exports = getLength; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/getMatchData.js: -------------------------------------------------------------------------------- 1 | var isStrictComparable = require('./isStrictComparable'), 2 | pairs = require('../object/pairs'); 3 | 4 | /** 5 | * Gets the propery names, values, and compare flags of `object`. 6 | * 7 | * @private 8 | * @param {Object} object The object to query. 9 | * @returns {Array} Returns the match data of `object`. 10 | */ 11 | function getMatchData(object) { 12 | var result = pairs(object), 13 | length = result.length; 14 | 15 | while (length--) { 16 | result[length][2] = isStrictComparable(result[length][1]); 17 | } 18 | return result; 19 | } 20 | 21 | module.exports = getMatchData; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/getNative.js: -------------------------------------------------------------------------------- 1 | var isNative = require('../lang/isNative'); 2 | 3 | /** 4 | * Gets the native function at `key` of `object`. 5 | * 6 | * @private 7 | * @param {Object} object The object to query. 8 | * @param {string} key The key of the method to get. 9 | * @returns {*} Returns the function if it's native, else `undefined`. 10 | */ 11 | function getNative(object, key) { 12 | var value = object == null ? undefined : object[key]; 13 | return isNative(value) ? value : undefined; 14 | } 15 | 16 | module.exports = getNative; 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/initCloneObject.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Initializes an object clone. 3 | * 4 | * @private 5 | * @param {Object} object The object to clone. 6 | * @returns {Object} Returns the initialized clone. 7 | */ 8 | function initCloneObject(object) { 9 | var Ctor = object.constructor; 10 | if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { 11 | Ctor = Object; 12 | } 13 | return new Ctor; 14 | } 15 | 16 | module.exports = initCloneObject; 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/isArrayLike.js: -------------------------------------------------------------------------------- 1 | var getLength = require('./getLength'), 2 | isLength = require('./isLength'); 3 | 4 | /** 5 | * Checks if `value` is array-like. 6 | * 7 | * @private 8 | * @param {*} value The value to check. 9 | * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 10 | */ 11 | function isArrayLike(value) { 12 | return value != null && isLength(getLength(value)); 13 | } 14 | 15 | module.exports = isArrayLike; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/isObjectLike.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is object-like. 3 | * 4 | * @private 5 | * @param {*} value The value to check. 6 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 7 | */ 8 | function isObjectLike(value) { 9 | return !!value && typeof value == 'object'; 10 | } 11 | 12 | module.exports = isObjectLike; 13 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/isSpace.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a 3 | * character code is whitespace. 4 | * 5 | * @private 6 | * @param {number} charCode The character code to inspect. 7 | * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. 8 | */ 9 | function isSpace(charCode) { 10 | return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || 11 | (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); 12 | } 13 | 14 | module.exports = isSpace; 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/isStrictComparable.js: -------------------------------------------------------------------------------- 1 | var isObject = require('../lang/isObject'); 2 | 3 | /** 4 | * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 5 | * 6 | * @private 7 | * @param {*} value The value to check. 8 | * @returns {boolean} Returns `true` if `value` if suitable for strict 9 | * equality comparisons, else `false`. 10 | */ 11 | function isStrictComparable(value) { 12 | return value === value && !isObject(value); 13 | } 14 | 15 | module.exports = isStrictComparable; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/lazyReverse.js: -------------------------------------------------------------------------------- 1 | var LazyWrapper = require('./LazyWrapper'); 2 | 3 | /** 4 | * Reverses the direction of lazy iteration. 5 | * 6 | * @private 7 | * @name reverse 8 | * @memberOf LazyWrapper 9 | * @returns {Object} Returns the new reversed `LazyWrapper` object. 10 | */ 11 | function lazyReverse() { 12 | if (this.__filtered__) { 13 | var result = new LazyWrapper(this); 14 | result.__dir__ = -1; 15 | result.__filtered__ = true; 16 | } else { 17 | result = this.clone(); 18 | result.__dir__ *= -1; 19 | } 20 | return result; 21 | } 22 | 23 | module.exports = lazyReverse; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/mapDelete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Removes `key` and its value from the cache. 3 | * 4 | * @private 5 | * @name delete 6 | * @memberOf _.memoize.Cache 7 | * @param {string} key The key of the value to remove. 8 | * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. 9 | */ 10 | function mapDelete(key) { 11 | return this.has(key) && delete this.__data__[key]; 12 | } 13 | 14 | module.exports = mapDelete; 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/mapGet.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Gets the cached value for `key`. 3 | * 4 | * @private 5 | * @name get 6 | * @memberOf _.memoize.Cache 7 | * @param {string} key The key of the value to get. 8 | * @returns {*} Returns the cached value. 9 | */ 10 | function mapGet(key) { 11 | return key == '__proto__' ? undefined : this.__data__[key]; 12 | } 13 | 14 | module.exports = mapGet; 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/mapHas.js: -------------------------------------------------------------------------------- 1 | /** Used for native method references. */ 2 | var objectProto = Object.prototype; 3 | 4 | /** Used to check objects for own properties. */ 5 | var hasOwnProperty = objectProto.hasOwnProperty; 6 | 7 | /** 8 | * Checks if a cached value for `key` exists. 9 | * 10 | * @private 11 | * @name has 12 | * @memberOf _.memoize.Cache 13 | * @param {string} key The key of the entry to check. 14 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 15 | */ 16 | function mapHas(key) { 17 | return key != '__proto__' && hasOwnProperty.call(this.__data__, key); 18 | } 19 | 20 | module.exports = mapHas; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/mapSet.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sets `value` to `key` of the cache. 3 | * 4 | * @private 5 | * @name set 6 | * @memberOf _.memoize.Cache 7 | * @param {string} key The key of the value to cache. 8 | * @param {*} value The value to cache. 9 | * @returns {Object} Returns the cache object. 10 | */ 11 | function mapSet(key, value) { 12 | if (key != '__proto__') { 13 | this.__data__[key] = value; 14 | } 15 | return this; 16 | } 17 | 18 | module.exports = mapSet; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/mergeDefaults.js: -------------------------------------------------------------------------------- 1 | var merge = require('../object/merge'); 2 | 3 | /** 4 | * Used by `_.defaultsDeep` to customize its `_.merge` use. 5 | * 6 | * @private 7 | * @param {*} objectValue The destination object property value. 8 | * @param {*} sourceValue The source object property value. 9 | * @returns {*} Returns the value to assign to the destination object. 10 | */ 11 | function mergeDefaults(objectValue, sourceValue) { 12 | return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults); 13 | } 14 | 15 | module.exports = mergeDefaults; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/metaMap.js: -------------------------------------------------------------------------------- 1 | var getNative = require('./getNative'); 2 | 3 | /** Native method references. */ 4 | var WeakMap = getNative(global, 'WeakMap'); 5 | 6 | /** Used to store function metadata. */ 7 | var metaMap = WeakMap && new WeakMap; 8 | 9 | module.exports = metaMap; 10 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/pickByCallback.js: -------------------------------------------------------------------------------- 1 | var baseForIn = require('./baseForIn'); 2 | 3 | /** 4 | * A specialized version of `_.pick` which picks `object` properties `predicate` 5 | * returns truthy for. 6 | * 7 | * @private 8 | * @param {Object} object The source object. 9 | * @param {Function} predicate The function invoked per iteration. 10 | * @returns {Object} Returns the new object. 11 | */ 12 | function pickByCallback(object, predicate) { 13 | var result = {}; 14 | baseForIn(object, function(value, key, object) { 15 | if (predicate(value, key, object)) { 16 | result[key] = value; 17 | } 18 | }); 19 | return result; 20 | } 21 | 22 | module.exports = pickByCallback; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/reEscape.js: -------------------------------------------------------------------------------- 1 | /** Used to match template delimiters. */ 2 | var reEscape = /<%-([\s\S]+?)%>/g; 3 | 4 | module.exports = reEscape; 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/reEvaluate.js: -------------------------------------------------------------------------------- 1 | /** Used to match template delimiters. */ 2 | var reEvaluate = /<%([\s\S]+?)%>/g; 3 | 4 | module.exports = reEvaluate; 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/reInterpolate.js: -------------------------------------------------------------------------------- 1 | /** Used to match template delimiters. */ 2 | var reInterpolate = /<%=([\s\S]+?)%>/g; 3 | 4 | module.exports = reInterpolate; 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/realNames.js: -------------------------------------------------------------------------------- 1 | /** Used to lookup unminified function names. */ 2 | var realNames = {}; 3 | 4 | module.exports = realNames; 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/toIterable.js: -------------------------------------------------------------------------------- 1 | var isArrayLike = require('./isArrayLike'), 2 | isObject = require('../lang/isObject'), 3 | values = require('../object/values'); 4 | 5 | /** 6 | * Converts `value` to an array-like object if it's not one. 7 | * 8 | * @private 9 | * @param {*} value The value to process. 10 | * @returns {Array|Object} Returns the array-like object. 11 | */ 12 | function toIterable(value) { 13 | if (value == null) { 14 | return []; 15 | } 16 | if (!isArrayLike(value)) { 17 | return values(value); 18 | } 19 | return isObject(value) ? value : Object(value); 20 | } 21 | 22 | module.exports = toIterable; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/toObject.js: -------------------------------------------------------------------------------- 1 | var isObject = require('../lang/isObject'); 2 | 3 | /** 4 | * Converts `value` to an object if it's not one. 5 | * 6 | * @private 7 | * @param {*} value The value to process. 8 | * @returns {Object} Returns the object. 9 | */ 10 | function toObject(value) { 11 | return isObject(value) ? value : Object(value); 12 | } 13 | 14 | module.exports = toObject; 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/trimmedLeftIndex.js: -------------------------------------------------------------------------------- 1 | var isSpace = require('./isSpace'); 2 | 3 | /** 4 | * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace 5 | * character of `string`. 6 | * 7 | * @private 8 | * @param {string} string The string to inspect. 9 | * @returns {number} Returns the index of the first non-whitespace character. 10 | */ 11 | function trimmedLeftIndex(string) { 12 | var index = -1, 13 | length = string.length; 14 | 15 | while (++index < length && isSpace(string.charCodeAt(index))) {} 16 | return index; 17 | } 18 | 19 | module.exports = trimmedLeftIndex; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/trimmedRightIndex.js: -------------------------------------------------------------------------------- 1 | var isSpace = require('./isSpace'); 2 | 3 | /** 4 | * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace 5 | * character of `string`. 6 | * 7 | * @private 8 | * @param {string} string The string to inspect. 9 | * @returns {number} Returns the index of the last non-whitespace character. 10 | */ 11 | function trimmedRightIndex(string) { 12 | var index = string.length; 13 | 14 | while (index-- && isSpace(string.charCodeAt(index))) {} 15 | return index; 16 | } 17 | 18 | module.exports = trimmedRightIndex; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/unescapeHtmlChar.js: -------------------------------------------------------------------------------- 1 | /** Used to map HTML entities to characters. */ 2 | var htmlUnescapes = { 3 | '&': '&', 4 | '<': '<', 5 | '>': '>', 6 | '"': '"', 7 | ''': "'", 8 | '`': '`' 9 | }; 10 | 11 | /** 12 | * Used by `_.unescape` to convert HTML entities to characters. 13 | * 14 | * @private 15 | * @param {string} chr The matched character to unescape. 16 | * @returns {string} Returns the unescaped character. 17 | */ 18 | function unescapeHtmlChar(chr) { 19 | return htmlUnescapes[chr]; 20 | } 21 | 22 | module.exports = unescapeHtmlChar; 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/internal/wrapperClone.js: -------------------------------------------------------------------------------- 1 | var LazyWrapper = require('./LazyWrapper'), 2 | LodashWrapper = require('./LodashWrapper'), 3 | arrayCopy = require('./arrayCopy'); 4 | 5 | /** 6 | * Creates a clone of `wrapper`. 7 | * 8 | * @private 9 | * @param {Object} wrapper The wrapper to clone. 10 | * @returns {Object} Returns the cloned wrapper. 11 | */ 12 | function wrapperClone(wrapper) { 13 | return wrapper instanceof LazyWrapper 14 | ? wrapper.clone() 15 | : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); 16 | } 17 | 18 | module.exports = wrapperClone; 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/eq.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./isEqual'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/gt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is greater than `other`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to compare. 8 | * @param {*} other The other value to compare. 9 | * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. 10 | * @example 11 | * 12 | * _.gt(3, 1); 13 | * // => true 14 | * 15 | * _.gt(3, 3); 16 | * // => false 17 | * 18 | * _.gt(1, 3); 19 | * // => false 20 | */ 21 | function gt(value, other) { 22 | return value > other; 23 | } 24 | 25 | module.exports = gt; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/gte.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is greater than or equal to `other`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to compare. 8 | * @param {*} other The other value to compare. 9 | * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. 10 | * @example 11 | * 12 | * _.gte(3, 1); 13 | * // => true 14 | * 15 | * _.gte(3, 3); 16 | * // => true 17 | * 18 | * _.gte(1, 3); 19 | * // => false 20 | */ 21 | function gte(value, other) { 22 | return value >= other; 23 | } 24 | 25 | module.exports = gte; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/isElement.js: -------------------------------------------------------------------------------- 1 | var isObjectLike = require('../internal/isObjectLike'), 2 | isPlainObject = require('./isPlainObject'); 3 | 4 | /** 5 | * Checks if `value` is a DOM element. 6 | * 7 | * @static 8 | * @memberOf _ 9 | * @category Lang 10 | * @param {*} value The value to check. 11 | * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 12 | * @example 13 | * 14 | * _.isElement(document.body); 15 | * // => true 16 | * 17 | * _.isElement(''); 18 | * // => false 19 | */ 20 | function isElement(value) { 21 | return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); 22 | } 23 | 24 | module.exports = isElement; 25 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/isNull.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is `null`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to check. 8 | * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 9 | * @example 10 | * 11 | * _.isNull(null); 12 | * // => true 13 | * 14 | * _.isNull(void 0); 15 | * // => false 16 | */ 17 | function isNull(value) { 18 | return value === null; 19 | } 20 | 21 | module.exports = isNull; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/isUndefined.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is `undefined`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to check. 8 | * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 9 | * @example 10 | * 11 | * _.isUndefined(void 0); 12 | * // => true 13 | * 14 | * _.isUndefined(null); 15 | * // => false 16 | */ 17 | function isUndefined(value) { 18 | return value === undefined; 19 | } 20 | 21 | module.exports = isUndefined; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/lt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is less than `other`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to compare. 8 | * @param {*} other The other value to compare. 9 | * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. 10 | * @example 11 | * 12 | * _.lt(1, 3); 13 | * // => true 14 | * 15 | * _.lt(3, 3); 16 | * // => false 17 | * 18 | * _.lt(3, 1); 19 | * // => false 20 | */ 21 | function lt(value, other) { 22 | return value < other; 23 | } 24 | 25 | module.exports = lt; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/lang/lte.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checks if `value` is less than or equal to `other`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Lang 7 | * @param {*} value The value to compare. 8 | * @param {*} other The other value to compare. 9 | * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. 10 | * @example 11 | * 12 | * _.lte(1, 3); 13 | * // => true 14 | * 15 | * _.lte(3, 3); 16 | * // => true 17 | * 18 | * _.lte(3, 1); 19 | * // => false 20 | */ 21 | function lte(value, other) { 22 | return value <= other; 23 | } 24 | 25 | module.exports = lte; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/math.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'add': require('./math/add'), 3 | 'ceil': require('./math/ceil'), 4 | 'floor': require('./math/floor'), 5 | 'max': require('./math/max'), 6 | 'min': require('./math/min'), 7 | 'round': require('./math/round'), 8 | 'sum': require('./math/sum') 9 | }; 10 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/math/add.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Adds two numbers. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Math 7 | * @param {number} augend The first number to add. 8 | * @param {number} addend The second number to add. 9 | * @returns {number} Returns the sum. 10 | * @example 11 | * 12 | * _.add(6, 4); 13 | * // => 10 14 | */ 15 | function add(augend, addend) { 16 | return (+augend || 0) + (+addend || 0); 17 | } 18 | 19 | module.exports = add; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/math/ceil.js: -------------------------------------------------------------------------------- 1 | var createRound = require('../internal/createRound'); 2 | 3 | /** 4 | * Calculates `n` rounded up to `precision`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category Math 9 | * @param {number} n The number to round up. 10 | * @param {number} [precision=0] The precision to round up to. 11 | * @returns {number} Returns the rounded up number. 12 | * @example 13 | * 14 | * _.ceil(4.006); 15 | * // => 5 16 | * 17 | * _.ceil(6.004, 2); 18 | * // => 6.01 19 | * 20 | * _.ceil(6040, -2); 21 | * // => 6100 22 | */ 23 | var ceil = createRound('ceil'); 24 | 25 | module.exports = ceil; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/math/floor.js: -------------------------------------------------------------------------------- 1 | var createRound = require('../internal/createRound'); 2 | 3 | /** 4 | * Calculates `n` rounded down to `precision`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category Math 9 | * @param {number} n The number to round down. 10 | * @param {number} [precision=0] The precision to round down to. 11 | * @returns {number} Returns the rounded down number. 12 | * @example 13 | * 14 | * _.floor(4.006); 15 | * // => 4 16 | * 17 | * _.floor(0.046, 2); 18 | * // => 0.04 19 | * 20 | * _.floor(4060, -2); 21 | * // => 4000 22 | */ 23 | var floor = createRound('floor'); 24 | 25 | module.exports = floor; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/math/round.js: -------------------------------------------------------------------------------- 1 | var createRound = require('../internal/createRound'); 2 | 3 | /** 4 | * Calculates `n` rounded to `precision`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category Math 9 | * @param {number} n The number to round. 10 | * @param {number} [precision=0] The precision to round to. 11 | * @returns {number} Returns the rounded number. 12 | * @example 13 | * 14 | * _.round(4.006); 15 | * // => 4 16 | * 17 | * _.round(4.006, 2); 18 | * // => 4.01 19 | * 20 | * _.round(4060, -2); 21 | * // => 4100 22 | */ 23 | var round = createRound('round'); 24 | 25 | module.exports = round; 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/number.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'inRange': require('./number/inRange'), 3 | 'random': require('./number/random') 4 | }; 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/object/extend.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./assign'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/object/functions.js: -------------------------------------------------------------------------------- 1 | var baseFunctions = require('../internal/baseFunctions'), 2 | keysIn = require('./keysIn'); 3 | 4 | /** 5 | * Creates an array of function property names from all enumerable properties, 6 | * own and inherited, of `object`. 7 | * 8 | * @static 9 | * @memberOf _ 10 | * @alias methods 11 | * @category Object 12 | * @param {Object} object The object to inspect. 13 | * @returns {Array} Returns the new array of property names. 14 | * @example 15 | * 16 | * _.functions(_); 17 | * // => ['after', 'ary', 'assign', ...] 18 | */ 19 | function functions(object) { 20 | return baseFunctions(object, keysIn(object)); 21 | } 22 | 23 | module.exports = functions; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/object/methods.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./functions'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/string/capitalize.js: -------------------------------------------------------------------------------- 1 | var baseToString = require('../internal/baseToString'); 2 | 3 | /** 4 | * Capitalizes the first character of `string`. 5 | * 6 | * @static 7 | * @memberOf _ 8 | * @category String 9 | * @param {string} [string=''] The string to capitalize. 10 | * @returns {string} Returns the capitalized string. 11 | * @example 12 | * 13 | * _.capitalize('fred'); 14 | * // => 'Fred' 15 | */ 16 | function capitalize(string) { 17 | string = baseToString(string); 18 | return string && (string.charAt(0).toUpperCase() + string.slice(1)); 19 | } 20 | 21 | module.exports = capitalize; 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/support.js: -------------------------------------------------------------------------------- 1 | /** 2 | * An object environment feature flags. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @type Object 7 | */ 8 | var support = {}; 9 | 10 | module.exports = support; 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/utility/constant.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a function that returns `value`. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Utility 7 | * @param {*} value The value to return from the new function. 8 | * @returns {Function} Returns the new function. 9 | * @example 10 | * 11 | * var object = { 'user': 'fred' }; 12 | * var getter = _.constant(object); 13 | * 14 | * getter() === object; 15 | * // => true 16 | */ 17 | function constant(value) { 18 | return function() { 19 | return value; 20 | }; 21 | } 22 | 23 | module.exports = constant; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/utility/identity.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This method returns the first argument provided to it. 3 | * 4 | * @static 5 | * @memberOf _ 6 | * @category Utility 7 | * @param {*} value Any value. 8 | * @returns {*} Returns `value`. 9 | * @example 10 | * 11 | * var object = { 'user': 'fred' }; 12 | * 13 | * _.identity(object) === object; 14 | * // => true 15 | */ 16 | function identity(value) { 17 | return value; 18 | } 19 | 20 | module.exports = identity; 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/utility/iteratee.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./callback'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/utility/noop.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A no-operation function that returns `undefined` regardless of the 3 | * arguments it receives. 4 | * 5 | * @static 6 | * @memberOf _ 7 | * @category Utility 8 | * @example 9 | * 10 | * var object = { 'user': 'fred' }; 11 | * 12 | * _.noop(object) === undefined; 13 | * // => true 14 | */ 15 | function noop() { 16 | // No operation performed. 17 | } 18 | 19 | module.exports = noop; 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/patrun/node_modules/lodash/utility/uniqueId.js: -------------------------------------------------------------------------------- 1 | var baseToString = require('../internal/baseToString'); 2 | 3 | /** Used to generate unique IDs. */ 4 | var idCounter = 0; 5 | 6 | /** 7 | * Generates a unique ID. If `prefix` is provided the ID is appended to it. 8 | * 9 | * @static 10 | * @memberOf _ 11 | * @category Utility 12 | * @param {string} [prefix] The value to prefix the ID with. 13 | * @returns {string} Returns the unique ID. 14 | * @example 15 | * 16 | * _.uniqueId('contact_'); 17 | * // => 'contact_104' 18 | * 19 | * _.uniqueId(); 20 | * // => '105' 21 | */ 22 | function uniqueId(prefix) { 23 | var id = ++idCounter; 24 | return baseToString(prefix) + id; 25 | } 26 | 27 | module.exports = uniqueId; 28 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/rolling-stats/README.md: -------------------------------------------------------------------------------- 1 | rolling-stats 2 | ============= 3 | 4 | 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-basic/node_modules/async/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "iojs" 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-basic/node_modules/async/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "async", 3 | "description": "Higher-order functions and common patterns for asynchronous code", 4 | "version": "0.9.2", 5 | "keywords": [ 6 | "async", 7 | "callback", 8 | "utility", 9 | "module" 10 | ], 11 | "license": "MIT", 12 | "repository": "caolan/async", 13 | "scripts": [ 14 | "lib/async.js" 15 | ] 16 | } -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/.bin/needle: -------------------------------------------------------------------------------- 1 | ../needle/bin/needle -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/async/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.12" 5 | - "iojs" 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/async/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "async", 3 | "description": "Higher-order functions and common patterns for asynchronous code", 4 | "version": "0.9.2", 5 | "keywords": [ 6 | "async", 7 | "callback", 8 | "utility", 9 | "module" 10 | ], 11 | "license": "MIT", 12 | "repository": "caolan/async", 13 | "scripts": [ 14 | "lib/async.js" 15 | ] 16 | } -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/README.md: -------------------------------------------------------------------------------- 1 | # connect-query 2 | 3 | Parse query parameters in Connect or Express 4 | 5 | [![NPM version](https://badge.fury.io/js/connect-query.png)](http://badge.fury.io/js/connect-query) 6 | 7 | ## Install 8 | 9 | ``` 10 | npm install connect-query --save 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | var connect = require('connect'); 17 | var query = require('connect-query'); 18 | var app = connect(); 19 | 20 | app.use(query()); 21 | 22 | app.listen(300); 23 | ``` 24 | 25 | ## Run tests 26 | 27 | ``` 28 | npm install 29 | npm test 30 | ``` 31 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/index.js: -------------------------------------------------------------------------------- 1 | var qs = require('qs'); 2 | var url = require('url'); 3 | 4 | module.exports = function () { 5 | return function (req, res, next) { 6 | var parsedUrl = url.parse(req.url); 7 | req.query = qs.parse(parsedUrl.query); 8 | next(); 9 | }; 10 | }; -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | 4 | "curly": true, 5 | "latedef": true, 6 | "quotmark": true, 7 | "undef": true, 8 | "unused": true, 9 | "trailing": true 10 | } 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | npm-debug.log 4 | dump.rdb 5 | node_modules 6 | results.tap 7 | results.xml 8 | npm-shrinkwrap.json 9 | config.json 10 | .DS_Store 11 | */.DS_Store 12 | */*/.DS_Store 13 | ._* 14 | */._* 15 | */*/._* 16 | coverage.* 17 | lib-cov 18 | complexity.md 19 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 0.10 -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @node node_modules/lab/bin/lab 3 | test-cov: 4 | @node node_modules/lab/bin/lab -t 100 5 | test-cov-html: 6 | @node node_modules/lab/bin/lab -r html -o coverage.html 7 | 8 | .PHONY: test test-cov test-cov-html -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib'); 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-query/node_modules/qs/lib/index.js: -------------------------------------------------------------------------------- 1 | // Load modules 2 | 3 | var Stringify = require('./stringify'); 4 | var Parse = require('./parse'); 5 | 6 | 7 | // Declare internals 8 | 9 | var internals = {}; 10 | 11 | 12 | module.exports = { 13 | stringify: Stringify, 14 | parse: Parse 15 | }; 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.1.3", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.1.3", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/http-errors/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/http-errors/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect-timeout/node_modules/on-headers/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2015-09-29 2 | ================== 3 | 4 | * perf: enable strict mode 5 | 6 | 1.0.0 / 2014-08-10 7 | ================== 8 | 9 | * Honor `res.statusCode` change in `listener` 10 | * Move to `jshttp` orgainzation 11 | * Prevent `arguments`-related de-opt 12 | 13 | 0.0.0 / 2014-05-13 14 | ================== 15 | 16 | * Initial implementation 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/.npmignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | docs/ 3 | test/ 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/connect'); 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "1.0.3", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "guille/ms.js": "0.6.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/.npmignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | test/ 3 | .travis.yml 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.0.2 / 2014-06-19 2 | ================== 3 | 4 | * Handle invalid status codes 5 | 6 | 0.0.1 / 2014-06-05 7 | ================== 8 | 9 | * deps: debug@1.0.2 10 | 11 | 0.0.0 / 2014-06-05 12 | ================== 13 | 14 | * Extracted from connect/express 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "1.0.2", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "guille/ms.js": "0.6.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": ["escape", "html", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Escape special characters in the given string of html. 3 | * 4 | * @param {String} html 5 | * @return {String} 6 | * @api private 7 | */ 8 | 9 | module.exports = function(html) { 10 | return String(html) 11 | .replace(/&/g, '&') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, ''') 14 | .replace(//g, '>'); 16 | } 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/parseurl/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.1.3 / 2014-07-08 2 | ================== 3 | 4 | * Fix typo 5 | 6 | 1.1.2 / 2014-07-08 7 | ================== 8 | 9 | * Seriously fix Node.js 0.8 compatibility 10 | 11 | 1.1.1 / 2014-07-08 12 | ================== 13 | 14 | * Fix Node.js 0.8 compatibility 15 | 16 | 1.1.0 / 2014-07-08 17 | ================== 18 | 19 | * Incorporate URL href-only parse fast-path 20 | 21 | 1.0.1 / 2014-03-08 22 | ================== 23 | 24 | * Add missing `require` 25 | 26 | 1.0.0 / 2014-03-08 27 | ================== 28 | 29 | * Genesis from `connect` 30 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/connect/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/.npmignore: -------------------------------------------------------------------------------- 1 | *~ 2 | node_modules 3 | temp 4 | sandbox 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/deflated-stream.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | stream = require('stream'), 3 | needle = require('./../'); 4 | 5 | var url = 'http://ibl.gamechaser.net/f/tagqfxtteucbuldhezkz/bt_level1.gz'; 6 | 7 | var resp = needle.get(url, { compressed: true, follow: true }); 8 | console.log('Downloading...'); 9 | 10 | resp.on('readable', function() { 11 | 12 | while (data = this.read()) { 13 | var lines = data.toString().split('\n'); 14 | console.log('Got ' + lines.length + ' items.'); 15 | // console.log(lines); 16 | } 17 | 18 | }) 19 | 20 | resp.on('end', function(data) { 21 | console.log('Done'); 22 | }) 23 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/digest-auth.js: -------------------------------------------------------------------------------- 1 | var needle = require('./..'); 2 | 3 | var opts = { 4 | username: 'user3', 5 | password: 'user3', 6 | auth: 'digest' 7 | } 8 | 9 | needle.get('http://test.webdav.org/auth-digest/', opts, function(err, resp, body){ 10 | console.log(resp.headers); 11 | 12 | if (resp.statusCode == 401) 13 | console.log('\nIt failed.') 14 | else 15 | console.log('\nIt worked!') 16 | }); 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/download-to-file.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | needle = require('./..'), 3 | path = require('path'); 4 | 5 | var url = process.argv[2] || 'https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png'; 6 | var file = path.basename(url); 7 | 8 | console.log('Downloading ' + file); 9 | 10 | needle.get(url, { output: file, follow: 3 }, function(err, resp, data){ 11 | console.log('File saved: ' + process.cwd() + '/' + file); 12 | console.log(resp.bytes + ' bytes transferred.'); 13 | }); 14 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/multipart-stream.js: -------------------------------------------------------------------------------- 1 | var needle = require('./../'); 2 | 3 | var url = 'http://posttestserver.com/post.php?dir=needle'; 4 | 5 | var black_pixel = new Buffer("R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=", 'base64'); 6 | 7 | var data = { 8 | foo: 'bar', 9 | nested: { 10 | test: 123 11 | }, 12 | image: { buffer: black_pixel, content_type: 'image/gif' } 13 | } 14 | 15 | var resp = needle.post(url, data, { multipart: true }); 16 | 17 | resp.on('readable', function() { 18 | while (data = this.read()) { 19 | console.log(data.toString()); 20 | } 21 | }) 22 | 23 | resp.on('end', function(data) { 24 | console.log('Done.'); 25 | }) 26 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/parsed-stream.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////// 2 | // This example demonstrates what happends 3 | // when you use the built-in JSON parser. 4 | ////////////////////////////////////////// 5 | 6 | var fs = require('fs'), 7 | stream = require('stream'), 8 | needle = require('./../'); 9 | 10 | var url = 'http://ip.jsontest.com/', 11 | resp = needle.get(url, { parse: true }); 12 | 13 | resp.on('readable', function(obj) { 14 | var chunk; 15 | 16 | while (chunk = this.read()) { 17 | console.log('root = ', chunk); 18 | } 19 | }); 20 | 21 | resp.on('end', function() { 22 | console.log('Done.'); 23 | }); 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/stream-events.js: -------------------------------------------------------------------------------- 1 | var needle = require('./..'); 2 | 3 | var resp = needle.get('google.com', { follow: true, timeout: 5000 }); 4 | 5 | resp.on('readable', function() { 6 | var chunk; 7 | while (chunk = this.read()) { 8 | console.log('Got ' + chunk.length + ' bytes'); 9 | } 10 | }) 11 | 12 | resp.on('headers', function(headers) { 13 | console.log('Got headers', headers); 14 | }) 15 | 16 | resp.on('redirect', function(url) { 17 | console.log('Redirected to url ' + url); 18 | }) 19 | 20 | resp.on('end', function(err) { 21 | console.log('Finished. No more data to receive.'); 22 | if (err) console.log('With error', err) 23 | }) 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/examples/stream-to-file.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'), 2 | needle = require('./..'), 3 | path = require('path'); 4 | 5 | var url = process.argv[2] || 'http://www.google.com/images/errors/robot.png'; 6 | var file = path.basename(url); 7 | 8 | console.log('Downloading ' + file); 9 | needle.get(url).pipe(fs.createWriteStream(file)); 10 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.2.0", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.2.0", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/iconv-lite/.npmignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *sublime-* 3 | generation 4 | test 5 | wiki 6 | coverage 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/node_modules/iconv-lite/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | env: 3 | - CXX=g++-4.8 4 | language: node_js 5 | node_js: 6 | - "0.8" 7 | - "0.10" 8 | - "0.11" 9 | - "0.12" 10 | - "iojs" 11 | - "4.0" 12 | addons: 13 | apt: 14 | sources: 15 | - ubuntu-toolchain-r-test 16 | packages: 17 | - gcc-4.8 18 | - g++-4.8 19 | before_install: 20 | - "test $TRAVIS_NODE_VERSION != '0.8' || npm install -g npm@1.2.8000" 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/needle/test/utils/formidable.js: -------------------------------------------------------------------------------- 1 | var formidable = require('formidable'), 2 | http = require('http'), 3 | util = require('util'); 4 | 5 | var port = process.argv[2] || 8888; 6 | 7 | http.createServer(function(req, res) { 8 | var form = new formidable.IncomingForm(); 9 | form.parse(req, function(err, fields, files) { 10 | res.writeHead(200, {'content-type': 'text/plain'}); 11 | res.write('received upload:\n\n'); 12 | console.log(util.inspect({fields: fields, files: files})) 13 | res.end(util.inspect({fields: fields, files: files})); 14 | }); 15 | }).listen(port); 16 | 17 | console.log('HTTP server listening on port ' + port); -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.sw* 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/index.js: -------------------------------------------------------------------------------- 1 | var net = require('net'); 2 | var inject = require('reconnect-core'); 3 | 4 | module.exports = inject(function () { 5 | var args = [].slice.call(arguments); 6 | return net.connect.apply(null, args); 7 | }); 8 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.sw* 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/node_modules/backoff/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/node_modules/backoff/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.6" 4 | - "0.7" 5 | - "0.8" 6 | - "0.10" 7 | 8 | notifications: 9 | email: 10 | - turcotte.mat@gmail.com 11 | 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/node_modules/backoff/doc/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/node_modules/backoff/doc/layers.png -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/node_modules/backoff/examples/reset.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var backoff = require('../index'); 4 | 5 | var backoff = backoff.exponential(); 6 | 7 | backoff.on('ready', function(number, delay) { 8 | console.log('Backoff done: ' + number + ' ' + delay + 'ms'); 9 | 10 | if (number < 15) { 11 | backoff.backoff(); 12 | } 13 | }); 14 | 15 | backoff.backoff(); 16 | 17 | setInterval(function() { 18 | backoff.reset(); 19 | backoff.backoff(); 20 | }, 5000); 21 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-transport/node_modules/reconnect-net/node_modules/reconnect-core/test/onconnect-listener.js: -------------------------------------------------------------------------------- 1 | var inject = require('..') 2 | var test = require('tape') 3 | var Stream = require('stream') 4 | var Emitter = require('events').EventEmitter 5 | var noop = function () {} 6 | 7 | var ee = new Emitter 8 | 9 | var reconnect = inject(function () { 10 | var s = new Stream 11 | process.nextTick(function () { 12 | s.emit('connect') 13 | s.emit('close') 14 | }) 15 | s.end = noop 16 | return s 17 | }) 18 | 19 | test('on connect listener', function (t) { 20 | t.plan(1) 21 | 22 | reconnect().on('connect', function () { 23 | t.ok(true) 24 | this.reconnect = false 25 | }).connect() 26 | }) 27 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/.npmignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | docs/ 3 | test/ 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/connect'); 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "1.0.3", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "guille/ms.js": "0.6.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/.npmignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | test/ 3 | .travis.yml 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.0.2 / 2014-06-19 2 | ================== 3 | 4 | * Handle invalid status codes 5 | 6 | 0.0.1 / 2014-06-05 7 | ================== 8 | 9 | * deps: debug@1.0.2 10 | 11 | 0.0.0 / 2014-06-05 12 | ================== 13 | 14 | * Extracted from connect/express 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "1.0.2", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "guille/ms.js": "0.6.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": ["escape", "html", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Escape special characters in the given string of html. 3 | * 4 | * @param {String} html 5 | * @return {String} 6 | * @api private 7 | */ 8 | 9 | module.exports = function(html) { 10 | return String(html) 11 | .replace(/&/g, '&') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, ''') 14 | .replace(//g, '>'); 16 | } 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/parseurl/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.1.3 / 2014-07-08 2 | ================== 3 | 4 | * Fix typo 5 | 6 | 1.1.2 / 2014-07-08 7 | ================== 8 | 9 | * Seriously fix Node.js 0.8 compatibility 10 | 11 | 1.1.1 / 2014-07-08 12 | ================== 13 | 14 | * Fix Node.js 0.8 compatibility 15 | 16 | 1.1.0 / 2014-07-08 17 | ================== 18 | 19 | * Incorporate URL href-only parse fast-path 20 | 21 | 1.0.1 / 2014-03-08 22 | ================== 23 | 24 | * Add missing `require` 25 | 26 | 1.0.0 / 2014-03-08 27 | ================== 28 | 29 | * Genesis from `connect` 30 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/connect/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/json-stringify-safe/.npmignore: -------------------------------------------------------------------------------- 1 | /*.tgz 2 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/json-stringify-safe/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --recursive 2 | --require must 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/mstring/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/mstring/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | - "0.10" 5 | - "0.8" 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/escape-html/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/escape-html/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/escape-html/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": ["escape", "html", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Escape special characters in the given string of html. 3 | * 4 | * @param {String} html 5 | * @return {String} 6 | * @api private 7 | */ 8 | 9 | module.exports = function(html) { 10 | return String(html) 11 | .replace(/&/g, '&') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, ''') 14 | .replace(//g, '>'); 16 | } 17 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/parseurl/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark/ 2 | coverage/ 3 | test/ 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/.bin/mime: -------------------------------------------------------------------------------- 1 | ../mime/cli.js -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.2.0", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.2.0", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = bufferConcat 12 | 13 | /** 14 | * Concatenate an array of Buffers. 15 | */ 16 | 17 | function bufferConcat(bufs) { 18 | var length = 0 19 | 20 | for (var i = 0, len = bufs.length; i < len; i++) { 21 | length += bufs[i].length 22 | } 23 | 24 | var buf = new Buffer(length) 25 | var pos = 0 26 | 27 | for (var i = 0, len = bufs.length; i < len; i++) { 28 | bufs[i].copy(buf, pos) 29 | pos += bufs[i].length 30 | } 31 | 32 | return buf 33 | } 34 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark 2 | src 3 | test 4 | .travis.yml 5 | bitcoin.png 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc1.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | module.exports = create('crc1', function(buf, previous) { 9 | var accum, byte, crc, _i, _len; 10 | if (!Buffer.isBuffer(buf)) { 11 | buf = Buffer(buf); 12 | } 13 | crc = ~~previous; 14 | accum = 0; 15 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 16 | byte = buf[_i]; 17 | accum += byte; 18 | } 19 | crc += accum % 256; 20 | return crc % 256; 21 | }); 22 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/create.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = function(model, calc) { 3 | var fn; 4 | fn = function(buf, previous) { 5 | return calc(buf, previous) >>> 0; 6 | }; 7 | fn.signed = calc; 8 | fn.unsigned = fn; 9 | fn.model = model; 10 | return fn; 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/hex.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = function(number) { 3 | var result; 4 | result = number.toString(16); 5 | while (result.length % 2) { 6 | result = "0" + result; 7 | } 8 | return result; 9 | }; 10 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/index.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = { 3 | crc1: require('./crc1'), 4 | crc8: require('./crc8'), 5 | crc81wire: require('./crc8_1wire'), 6 | crc16: require('./crc16'), 7 | crc16ccitt: require('./crc16_ccitt'), 8 | crc16modbus: require('./crc16_modbus'), 9 | crc24: require('./crc24'), 10 | crc32: require('./crc32') 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/fresh/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.2.4 / 2014-09-07 2 | ================== 3 | 4 | * Support Node.js 0.6 5 | 6 | 0.2.3 / 2014-09-07 7 | ================== 8 | 9 | * Move repository to jshttp 10 | 11 | 0.2.2 / 2014-02-19 12 | ================== 13 | 14 | * Revert "Fix for blank page on Safari reload" 15 | 16 | 0.2.1 / 2014-01-29 17 | ================== 18 | 19 | * fix: support max-age=0 for end-to-end revalidation 20 | 21 | 0.2.0 / 2013-08-11 22 | ================== 23 | 24 | * fix: return false for no-cache 25 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/mime/build/build.js: -------------------------------------------------------------------------------- 1 | var db = require('mime-db'); 2 | 3 | var mapByType = {}; 4 | Object.keys(db).forEach(function(key) { 5 | var extensions = db[key].extensions; 6 | if (extensions) { 7 | mapByType[key] = extensions; 8 | } 9 | }); 10 | 11 | console.log(JSON.stringify(mapByType)); 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/mime/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mime = require('./mime.js'); 4 | var file = process.argv[2]; 5 | var type = mime.lookup(file); 6 | 7 | process.stdout.write(type + '\n'); 8 | 9 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/send/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/node_modules/serve-static/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/seneca-web/web/_web_service_template.html: -------------------------------------------------------------------------------- 1 |
Statistics for the last 60 seconds...
2 |
3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/build.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "./node_modules/jshint" ]; then 2 | npm install jshint@2 3 | fi 4 | 5 | if [ ! -d "./node_modules/docco" ]; then 6 | npm install docco@0 7 | fi 8 | 9 | ./node_modules/.bin/jshint zig.js 10 | ./node_modules/.bin/docco zig.js -o doc 11 | cp -r doc/* ../gh-pages/zig/doc 12 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/aller-light.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.eot -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.ttf -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/doc/public/fonts/novecento-bold.woff -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "examples", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "async": "^0.9.0", 13 | "mongodb": "^1.4.19" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/examples/readme.js~: -------------------------------------------------------------------------------- 1 | 2 | var zig = require('..') 3 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/node_modules/seneca/node_modules/zig/test.sh: -------------------------------------------------------------------------------- 1 | if [ ! -d "./node_modules/mocha" ]; then 2 | npm install mocha@1 3 | fi 4 | 5 | ./node_modules/.bin/mocha test/zig.test.js 6 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/post.js: -------------------------------------------------------------------------------- 1 | module.exports = function (options) { 2 | 3 | /** 4 | * Queues a post message for printing and sending. 5 | */ 6 | this.add({channel: 'post', action: 'queue'}, function(msg, respond) { 7 | // Code to queue a post message. 8 | respond(null, {ok: "ok"}); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /Chapter 03/seneca-services/sms.js: -------------------------------------------------------------------------------- 1 | module.exports = function (options) { 2 | 3 | /** 4 | * Sends an email. 5 | */ 6 | this.add({channel: 'sms', action: 'send'}, function(msg, respond) { 7 | // Code to send a sms. 8 | respond(null, {ok: "ok"}); 9 | }); 10 | 11 | /** 12 | * Receives the pending SMS. 13 | */ 14 | this.add({channel: 'sms', action: 'pending'}, function(msg, respond) { 15 | // Code to read pending sms. 16 | respond(null, {ok: "ok"}); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /Chapter 04/README.md: -------------------------------------------------------------------------------- 1 | Hello world 2 | -------------------------------------------------------------------------------- /Chapter 04/emailing/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 04/emailing/README.md -------------------------------------------------------------------------------- /Chapter 04/emailing/app/test.js: -------------------------------------------------------------------------------- 1 | var mandrill = require("mandrill-api/mandrill"); 2 | var mandrillClient = new mandrill.Mandrill("5Tje9eDkVK4o7ZROEhb1Lw"); 3 | 4 | mandrillClient.users.info({}, function(result){ 5 | console.log(result); 6 | }, function(e){ 7 | console.log(e); 8 | }); 9 | -------------------------------------------------------------------------------- /Chapter 04/emailing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emailing", 3 | "version": "1.0.0", 4 | "description": "Emailing sub-system", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/dgonzalez/chapter4" 12 | }, 13 | "keywords": [ 14 | "microservices", 15 | "emailing" 16 | ], 17 | "author": "David Gonzalez", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/dgonzalez/chapter4/issues" 21 | }, 22 | "homepage": "https://github.com/dgonzalez/chapter4", 23 | "dependencies": { 24 | "mandrill-api": "^1.0.45", 25 | "nodemailer": "^1.10.0", 26 | "seneca": "^0.8.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 04/front-end/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 04/front-end/README.md -------------------------------------------------------------------------------- /Chapter 04/front-end/app/test.js: -------------------------------------------------------------------------------- 1 | var seneca = require("seneca")(); 2 | seneca.add({cmd: "test"}, function(args, done) { 3 | done(null, {response: "Hello World!"}); 4 | }); 5 | 6 | seneca.listen({port: 3000}); 7 | -------------------------------------------------------------------------------- /Chapter 04/front-end/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emailing", 3 | "version": "1.0.0", 4 | "description": "Emailing sub-system", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/dgonzalez/chapter4" 12 | }, 13 | "keywords": [ 14 | "microservices", 15 | "emailing" 16 | ], 17 | "author": "David Gonzalez", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/dgonzalez/chapter4/issues" 21 | }, 22 | "homepage": "https://github.com/dgonzalez/chapter4", 23 | "dependencies": { 24 | "body-parser": "^1.14.2", 25 | "express": "^4.13.3", 26 | "seneca": "^0.8.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 04/order-manager/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 04/order-manager/README.md -------------------------------------------------------------------------------- /Chapter 04/order-manager/app/.index.js.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 04/order-manager/app/.index.js.swo -------------------------------------------------------------------------------- /Chapter 04/order-manager/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emailing", 3 | "version": "1.0.0", 4 | "description": "Emailing sub-system", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/dgonzalez/chapter4" 12 | }, 13 | "keywords": [ 14 | "microservices", 15 | "emailing" 16 | ], 17 | "author": "David Gonzalez", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/dgonzalez/chapter4/issues" 21 | }, 22 | "homepage": "https://github.com/dgonzalez/chapter4", 23 | "dependencies": { 24 | "seneca": "^0.8.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Chapter 04/product-management/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 04/product-management/README.md -------------------------------------------------------------------------------- /Chapter 04/product-management/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emailing", 3 | "version": "1.0.0", 4 | "description": "Emailing sub-system", 5 | "main": "index.js", 6 | "keywords": [ 7 | "microservices", 8 | "products" 9 | ], 10 | "author": "David Gonzalez", 11 | "license": "ISC", 12 | "dependencies": { 13 | "body-parser": "^1.14.1", 14 | "debug": "^2.2.0", 15 | "express": "^4.13.3", 16 | "seneca": "^0.8.0", 17 | "seneca-mongo-store": "^0.2.0", 18 | "type-is": "^1.6.10" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter 04/snippets.js: -------------------------------------------------------------------------------- 1 | seneca.add({area: "product", action: "fetch"}, function(args, done) { 2 | var products = this.make("products"); 3 | products.list$({}, function(err, result) { 4 | done(err, result); 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /Chapter 05/escapedsql.js: -------------------------------------------------------------------------------- 1 | var mysql = require('mysql'); 2 | 3 | var connection = mysql.createConnection({ 4 | host: 'localhost', 5 | username: 'root', 6 | password: 'root' 7 | }); 8 | 9 | console.log(connection.escape("' OR 1=1 --")) 10 | -------------------------------------------------------------------------------- /Chapter 06/chai.js: -------------------------------------------------------------------------------- 1 | /*var chai = require('chai'); 2 | 3 | chai.should(); 4 | 5 | var foo = "Hello world"; 6 | console.log(foo); 7 | 8 | foo.should.equal('Hello world'); 9 | */ 10 | 11 | 12 | /*var expect = require('chai').expect; 13 | 14 | var foo = "Hello world"; 15 | 16 | expect(foo).to.equal("Hello world"); 17 | */ 18 | 19 | 20 | /*var expect = require('chai').expect; 21 | 22 | var animals = ['cat', 'dog', 'parrot']; 23 | 24 | expect(animals).to.have.length(4);*/ 25 | 26 | var assert = require('chai').assert; 27 | var myStringVar = 'Here is my string'; 28 | // No message: 29 | assert.typeOf(myStringVar, 'string'); 30 | // With message: 31 | assert.typeOf(myStringVar, 'string', 'myStringVar is not string type.'); 32 | // Asserting on length: 33 | assert.lengthOf(myStringVar, 17); 34 | -------------------------------------------------------------------------------- /Chapter 06/coverage/lcov-report/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | -------------------------------------------------------------------------------- /Chapter 06/coverage/lcov-report/sort-arrow-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 06/coverage/lcov-report/sort-arrow-sprite.png -------------------------------------------------------------------------------- /Chapter 06/david.js: -------------------------------------------------------------------------------- 1 | require('./openweather') 2 | 3 | console.log('started'); 4 | -------------------------------------------------------------------------------- /Chapter 06/main-banned.js: -------------------------------------------------------------------------------- 1 | var bannedWords = require('./banned-words')(); 2 | -------------------------------------------------------------------------------- /Chapter 06/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "chai.js", 6 | "dependencies": { 7 | }, 8 | "devDependencies": { 9 | "chai": "*" 10 | }, 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "author": "", 15 | "license": "ISC" 16 | } 17 | -------------------------------------------------------------------------------- /Chapter 06/proxy.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var httpProxy = require('http-proxy'); 3 | var proxy = httpProxy.createProxyServer({}); 4 | 5 | http.createServer(function(req, res) { 6 | console.log(req.rawHeaders); 7 | proxy.web(req, res, { target: 'http://localhost:3000' }); 8 | }).listen(4000); 9 | -------------------------------------------------------------------------------- /Chapter 06/sinon-stub.js: -------------------------------------------------------------------------------- 1 | var sinon = require('sinon'); 2 | var expect = require('chai').expect; 3 | 4 | function rollDice() { 5 | return -1 * Math.floor(Math.random() * 6) + 1; 6 | } 7 | describe("When rollDice gets called", function() { 8 | 9 | it("Math#random should be called with no arguments", function() { 10 | sinon.stub(Math, "random"); 11 | rollDice(); 12 | console.log(Math.random.calledWith()); 13 | }); 14 | it("bananas", function() { 15 | console.log("bananas"); 16 | }); 17 | after(function(){ 18 | http.get.restore(); 19 | }); 20 | }) 21 | -------------------------------------------------------------------------------- /Chapter 06/sinon-time.js: -------------------------------------------------------------------------------- 1 | 2 | var sinon = require('sinon'); 3 | var expect = require('chai').expect 4 | 5 | function areWeThereYet(callback) { 6 | 7 | setTimeout(function() { 8 | callback.apply(this); 9 | }, 10); 10 | 11 | } 12 | 13 | var clock; 14 | 15 | before(function(){ 16 | clock = sinon.useFakeTimers(); 17 | }); 18 | 19 | it("callback gets called after 10ms", function () { 20 | var callback = sinon.spy(); 21 | var throttled = areWeThereYet(callback); 22 | 23 | areWeThereYet(callback); 24 | 25 | clock.tick(9); 26 | expect(callback.notCalled).to.be.true; 27 | 28 | clock.tick(1); 29 | expect(callback.notCalled).to.be.false; 30 | }); 31 | 32 | after(function(){ 33 | clock.restore(); 34 | }); 35 | -------------------------------------------------------------------------------- /Chapter 06/sinon.js: -------------------------------------------------------------------------------- 1 | 2 | var sinon = require('sinon'); 3 | 4 | require('chai').should(); 5 | 6 | function calculateHypotenuse(x, y, callback) { 7 | callback(null, Math.sqrt(x*x + y*x)); 8 | } 9 | 10 | describe("When the user callculates the hypotenuse", function(){ 11 | it("should execute the callback passed as argument", function() { 12 | var callback = sinon.spy(); 13 | calculateHypotenuse(3, 3, callback); 14 | callback.called.should.be.true; 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Chapter 06/start-stop.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | 3 | var myServer = express(); 4 | 5 | var chai = require('chai'); 6 | 7 | myServer.get('/endpoint', function(req, res){ 8 | res.send('endpoint reached'); 9 | }); 10 | 11 | var serverHandler; 12 | 13 | before(function(){ 14 | serverHandler = myServer.listen(3000); 15 | }); 16 | 17 | describe("When executing 'GET' into /endpoint", function(){ 18 | it("should return 'endpoint reached'", function(){ 19 | // Your test logic here. http://localhost:3000 is your server. 20 | }); 21 | }); 22 | 23 | after(function(){ 24 | serverHandler.close(); 25 | }); 26 | -------------------------------------------------------------------------------- /Chapter 06/stop-words.js: -------------------------------------------------------------------------------- 1 | 2 | var _ = require('lodash'); 3 | var express = require('express'); 4 | 5 | var removeStopWords = require('./remove-stop-words')({bannedWords: ["kitten", "puppy", "parrot"]}); 6 | 7 | var app = express(); 8 | 9 | app.get('/filter', function(req, res) { 10 | removeStopWords(req.query.text, function(error, response){ 11 | res.send(response); 12 | }); 13 | }); 14 | 15 | app.listen(3000, function() { 16 | console.log("app started in port 3000"); 17 | }); 18 | -------------------------------------------------------------------------------- /Chapter 07/counter-metric.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')(); 2 | var pmx = require("pmx").init({ 3 | http: true, 4 | errors: true, 5 | custom_probes: true, 6 | network: true, 7 | ports: true 8 | }); 9 | var names = []; 10 | var probe = pmx.probe(); 11 | 12 | var counter = probe.counter({ 13 | name : 'Number of calls' 14 | }); 15 | 16 | seneca.add({cmd: 'counter'}, function(args, done){ 17 | counter.inc(); 18 | done(null, {result: "done!"}); 19 | }); 20 | 21 | seneca.listen({port: 8085}); 22 | -------------------------------------------------------------------------------- /Chapter 07/error-example.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')(); 2 | var pmx = require("pmx").init({ 3 | http: true, 4 | errors: true, 5 | custom_probes: true, 6 | network: true, 7 | ports: true 8 | }); 9 | var names = []; 10 | 11 | seneca.add({cmd: 'exception'}, function(args, done){ 12 | pmx.notify(new Error("Unexpected Exception!")); 13 | 14 | done(null ,{result: 100/args.number}); 15 | }); 16 | 17 | seneca.listen({port: 8085}); 18 | -------------------------------------------------------------------------------- /Chapter 07/express-error.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var pmx = require('pmx'); 3 | var app = express(); 4 | 5 | app.get('/', function(req, res, next) { 6 | if (req.query.number == 0) { 7 | pmx.notify(Error("Number cannot be 0")); 8 | } 9 | res.send("The result is " + 100/req.query.number); 10 | }); 11 | 12 | app.listen(5000, function() { 13 | console.log("Listening in port 5000"); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter 07/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | var seneca = require('seneca')(); 6 | 7 | var names = []; 8 | 9 | seneca.add({cmd: 'memory-leak'}, function(args, done){ 10 | names.push(args.name); 11 | greetings = "Hello " + args.name; 12 | done(null ,{result: greetings}); 13 | }); 14 | 15 | seneca.listen({port: 8080}); 16 | -------------------------------------------------------------------------------- /Chapter 07/probe-metric.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')(); 2 | var pmx = require("pmx").init({ 3 | http: true, 4 | errors: true, 5 | custom_probes: true, 6 | network: true, 7 | ports: true 8 | }); 9 | var names = []; 10 | var probe = pmx.probe(); 11 | 12 | var meter = probe.meter({ 13 | name : 'Calls per minute', 14 | samples : 60, 15 | timeframe : 3600 16 | }); 17 | 18 | seneca.add({cmd: 'calls-minute'}, function(args, done){ 19 | meter.mark(); 20 | done(null, {result: "done!"}); 21 | }); 22 | 23 | seneca.listen({port: 8085}); 24 | -------------------------------------------------------------------------------- /Chapter 07/requests.sh: -------------------------------------------------------------------------------- 1 | for i in {0..100000} 2 | do 3 | curl -d '{"cmd": "memory-leak", "name":"David"}' http://127.0.0.1:8080/act 4 | done 5 | -------------------------------------------------------------------------------- /Chapter 07/simple-metric.js: -------------------------------------------------------------------------------- 1 | var seneca = require('seneca')(); 2 | var pmx = require("pmx").init({ 3 | http: true, 4 | errors: true, 5 | custom_probes: true, 6 | network: true, 7 | ports: true 8 | }); 9 | var names = []; 10 | var probe = pmx.probe(); 11 | 12 | var meter = probe.metric({ 13 | name : 'Last call' 14 | }); 15 | 16 | seneca.add({cmd: 'last-call'}, function(args, done){ 17 | console.log(meter); 18 | meter.set(new Date().toISOString()); 19 | done(null, {result: "done!"}); 20 | }); 21 | 22 | seneca.listen({port: 8085}); 23 | -------------------------------------------------------------------------------- /Chapter 08/dockerfile/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos 2 | MAINTAINER David Gonzalez 3 | RUN curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - 4 | RUN yum -y install nodejs 5 | -------------------------------------------------------------------------------- /Chapter 08/example/error.js: -------------------------------------------------------------------------------- 1 | 2 | var express = require('express'); 3 | var app = express(); 4 | 5 | app.get('/', function (req, res) { 6 | res.send('Hello World!'); 7 | }); 8 | 9 | app.listen(3000, function () { 10 | console.log('Example app listening on port 3000!'); 11 | }); 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * express 3 | * Copyright(c) 2009-2013 TJ Holowaychuk 4 | * Copyright(c) 2013 Roman Shtylman 5 | * Copyright(c) 2014-2015 Douglas Christopher Wilson 6 | * MIT Licensed 7 | */ 8 | 9 | 'use strict'; 10 | 11 | module.exports = require('./lib/express'); 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mime-db 3 | * Copyright(c) 2014 Jonathan Ong 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = require('./db.json') 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/content-type/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2015-02-13 2 | ================== 3 | 4 | * Improve missing `Content-Type` header error message 5 | 6 | 1.0.0 / 2015-02-01 7 | ================== 8 | 9 | * Initial implementation, derived from `media-typer@0.3.0` 10 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/cookie-signature/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.2.0", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.2.0", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = bufferConcat 12 | 13 | /** 14 | * Concatenate an array of Buffers. 15 | */ 16 | 17 | function bufferConcat(bufs) { 18 | var length = 0 19 | 20 | for (var i = 0, len = bufs.length; i < len; i++) { 21 | length += bufs[i].length 22 | } 23 | 24 | var buf = new Buffer(length) 25 | var pos = 0 26 | 27 | for (var i = 0, len = bufs.length; i < len; i++) { 28 | bufs[i].copy(buf, pos) 29 | pos += bufs[i].length 30 | } 31 | 32 | return buf 33 | } 34 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * escape-html 3 | * Copyright(c) 2012-2013 TJ Holowaychuk 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | * @public 10 | */ 11 | 12 | module.exports = escapeHtml; 13 | 14 | /** 15 | * Escape special characters in the given string of html. 16 | * 17 | * @param {string} str The string to escape for inserting into HTML 18 | * @return {string} 19 | * @public 20 | */ 21 | 22 | function escapeHtml(html) { 23 | return String(html) 24 | .replace(/&/g, '&') 25 | .replace(/"/g, '"') 26 | .replace(/'/g, ''') 27 | .replace(//g, '>'); 29 | } 30 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/finalhandler/node_modules/unpipe/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.0 / 2015-06-14 2 | ================== 3 | 4 | * Initial release 5 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/merge-descriptors/README.md: -------------------------------------------------------------------------------- 1 | # Merge Descriptors 2 | 3 | Merge objects using descriptors. 4 | 5 | ```js 6 | var thing = { 7 | get name() { 8 | return 'jon' 9 | } 10 | } 11 | 12 | var animal = { 13 | 14 | } 15 | 16 | merge(animal, thing) 17 | 18 | animal.name === 'jon' 19 | ``` 20 | 21 | ## API 22 | 23 | ### merge(destination, source) 24 | 25 | Redefines `destination`'s descriptors with `source`'s. 26 | 27 | ### merge(destination, source, false) 28 | 29 | Defines `source`'s descriptors on `destination` if `destination` does not have 30 | a descriptor by the same name. 31 | 32 | ## License 33 | 34 | [MIT](LICENSE) 35 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/methods/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.1.2 / 2016-01-17 2 | ================== 3 | 4 | * perf: enable strict mode 5 | 6 | 1.1.1 / 2014-12-30 7 | ================== 8 | 9 | * Improve `browserify` support 10 | 11 | 1.1.0 / 2014-07-05 12 | ================== 13 | 14 | * Add `CONNECT` method 15 | 16 | 1.0.1 / 2014-06-02 17 | ================== 18 | 19 | * Fix module to work with harmony transform 20 | 21 | 1.0.0 / 2014-05-08 22 | ================== 23 | 24 | * Add `PURGE` method 25 | 26 | 0.1.0 / 2013-10-28 27 | ================== 28 | 29 | * Add `http.METHODS` support 30 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.1.0 / 2014-09-21 2 | ================== 3 | 4 | * Initial release 5 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "0.10" 5 | - "0.11" 6 | - "0.12" 7 | - "4.0" 8 | - "4.1" 9 | - "4.2" 10 | - "5" 11 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/Cakefile: -------------------------------------------------------------------------------- 1 | fs = require 'fs' 2 | CoffeeScript = require 'coffee-script' 3 | nodeunit = require 'nodeunit' 4 | UglifyJS = require 'uglify-js' 5 | 6 | task 'build', 'build the JavaScript files from CoffeeScript source', build = (cb) -> 7 | source = fs.readFileSync 'src/ipaddr.coffee' 8 | fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString() 9 | 10 | invoke 'test' 11 | invoke 'compress' 12 | 13 | task 'test', 'run the bundled tests', (cb) -> 14 | nodeunit.reporters.default.run ['test'] 15 | 16 | task 'compress', 'uglify the resulting javascript', (cb) -> 17 | result = UglifyJS.minify('lib/ipaddr.js') 18 | fs.writeFileSync('ipaddr.min.js', result.code) 19 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ipaddr.js", 3 | "version": "1.0.5", 4 | "homepage": "https://github.com/whitequark/ipaddr.js", 5 | "authors": [ 6 | "whitequark " 7 | ], 8 | "description": "IP address manipulation library in JavaScript (CoffeeScript, actually)", 9 | "main": "lib/ipaddr.js", 10 | "moduleType": [ 11 | "globals", 12 | "node" 13 | ], 14 | "keywords": [ 15 | "javscript", 16 | "ip", 17 | "address", 18 | "ipv4", 19 | "ipv6" 20 | ], 21 | "license": "MIT", 22 | "ignore": [ 23 | "**/.*", 24 | "node_modules", 25 | "bower_components", 26 | "test", 27 | "tests" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | npm-debug.log 4 | dump.rdb 5 | node_modules 6 | results.tap 7 | results.xml 8 | npm-shrinkwrap.json 9 | config.json 10 | .DS_Store 11 | */.DS_Store 12 | */*/.DS_Store 13 | ._* 14 | */._* 15 | */*/._* 16 | coverage.* 17 | lib-cov 18 | complexity.md 19 | dist 20 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 0.10 5 | - 0.12 6 | - iojs 7 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). 2 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qs", 3 | "main": "dist/qs.js", 4 | "version": "3.0.0", 5 | "homepage": "https://github.com/hapijs/qs", 6 | "authors": [ 7 | "Nathan LaFreniere " 8 | ], 9 | "description": "A querystring parser that supports nesting and arrays, with a depth limit", 10 | "keywords": [ 11 | "querystring", 12 | "qs" 13 | ], 14 | "license": "BSD-3-Clause", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/lib/index.js: -------------------------------------------------------------------------------- 1 | // Load modules 2 | 3 | var Stringify = require('./stringify'); 4 | var Parse = require('./parse'); 5 | 6 | 7 | // Declare internals 8 | 9 | var internals = {}; 10 | 11 | 12 | module.exports = { 13 | stringify: Stringify, 14 | parse: Parse 15 | }; 16 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/qs/test/utils.js: -------------------------------------------------------------------------------- 1 | // Load modules 2 | 3 | var Code = require('code'); 4 | var Lab = require('lab'); 5 | var Utils = require('../lib/utils'); 6 | 7 | 8 | // Declare internals 9 | 10 | var internals = {}; 11 | 12 | 13 | // Test shortcuts 14 | 15 | var lab = exports.lab = Lab.script(); 16 | var expect = Code.expect; 17 | var describe = lab.experiment; 18 | var it = lab.test; 19 | 20 | 21 | describe('merge()', function () { 22 | 23 | it('can merge two objects with the same key', function (done) { 24 | 25 | expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] }); 26 | done(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/.bin/mime: -------------------------------------------------------------------------------- 1 | ../mime/cli.js -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/mime/.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 08/example/node_modules/express/node_modules/send/node_modules/mime/.npmignore -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/mime/build/build.js: -------------------------------------------------------------------------------- 1 | var db = require('mime-db'); 2 | 3 | var mapByType = {}; 4 | Object.keys(db).forEach(function(key) { 5 | var extensions = db[key].extensions; 6 | if (extensions) { 7 | mapByType[key] = extensions; 8 | } 9 | }); 10 | 11 | console.log(JSON.stringify(mapByType)); 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/mime/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mime = require('./mime.js'); 4 | var file = process.argv[2]; 5 | var type = mime.lookup(file); 6 | 7 | process.stdout.write(type + '\n'); 8 | 9 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/send/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/.bin/mime: -------------------------------------------------------------------------------- 1 | ../mime/cli.js -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict' 8 | 9 | /** 10 | * Module exports. 11 | */ 12 | 13 | module.exports = bufferConcat 14 | 15 | /** 16 | * Concatenate an array of Buffers. 17 | */ 18 | 19 | function bufferConcat(bufs) { 20 | var length = 0 21 | 22 | for (var i = 0, len = bufs.length; i < len; i++) { 23 | length += bufs[i].length 24 | } 25 | 26 | var buf = new Buffer(length) 27 | var pos = 0 28 | 29 | for (var i = 0, len = bufs.length; i < len; i++) { 30 | bufs[i].copy(buf, pos) 31 | pos += bufs[i].length 32 | } 33 | 34 | return buf 35 | } 36 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/event-listener-count.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2015 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict' 8 | 9 | /** 10 | * Module exports. 11 | * @public 12 | */ 13 | 14 | module.exports = eventListenerCount 15 | 16 | /** 17 | * Get the count of listeners on an event emitter of a specific type. 18 | */ 19 | 20 | function eventListenerCount(emitter, type) { 21 | return emitter.listeners(type).length 22 | } 23 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Developing-Microservices-With-Nodejs/c1c1c81a587509bff98753ef9243f64bdf501e88/Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/build/build.js: -------------------------------------------------------------------------------- 1 | var db = require('mime-db'); 2 | 3 | var mapByType = {}; 4 | Object.keys(db).forEach(function(key) { 5 | var extensions = db[key].extensions; 6 | if (extensions) { 7 | mapByType[key] = extensions; 8 | } 9 | }); 10 | 11 | console.log(JSON.stringify(mapByType)); 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mime = require('./mime.js'); 4 | var file = process.argv[2]; 5 | var type = mime.lookup(file); 6 | 7 | process.stdout.write(type + '\n'); 8 | 9 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/type-is/node_modules/media-typer/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.3.0 / 2014-09-07 2 | ================== 3 | 4 | * Support Node.js 0.6 5 | * Throw error when parameter format invalid on parse 6 | 7 | 0.2.0 / 2014-06-18 8 | ================== 9 | 10 | * Add `typer.format()` to format media types 11 | 12 | 0.1.0 / 2014-06-17 13 | ================== 14 | 15 | * Accept `req` as argument to `parse` 16 | * Accept `res` as argument to `parse` 17 | * Parse media type with extra LWS between type and first parameter 18 | 19 | 0.0.0 / 2014-06-13 20 | ================== 21 | 22 | * Initial implementation 23 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mime-db 3 | * Copyright(c) 2014 Jonathan Ong 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = require('./db.json') 12 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /Chapter 08/example/node_modules/express/node_modules/vary/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2015-07-08 2 | ================== 3 | 4 | * Fix setting empty header from empty `field` 5 | * perf: enable strict mode 6 | * perf: remove argument reassignments 7 | 8 | 1.0.0 / 2014-08-10 9 | ================== 10 | 11 | * Accept valid `Vary` header string as `field` 12 | * Add `vary.append` for low-level string manipulation 13 | * Move to `jshttp` orgainzation 14 | 15 | 0.1.0 / 2014-06-05 16 | ================== 17 | 18 | * Support array of fields to set 19 | 20 | 0.0.0 / 2014-06-04 21 | ================== 22 | 23 | * Initial release 24 | -------------------------------------------------------------------------------- /Chapter 08/example/small-script.js: -------------------------------------------------------------------------------- 1 | 2 | var express = require('express'); 3 | var app = express(); 4 | 5 | app.get('/', function (req, res) { 6 | res.send('Hello World!'); 7 | }); 8 | 9 | app.listen(3000, function () { 10 | console.log('Example app listening on port 3000!'); 11 | }); 12 | -------------------------------------------------------------------------------- /Chapter 08/pm2-scale/app.js: -------------------------------------------------------------------------------- 1 | var http = require("http"); 2 | http.createServer(function (request, response) { 3 | response.writeHead(200, { 4 | 'Content-Type': 'text/plain' 5 | }); 6 | response.write('Here we are!') 7 | response.end(); 8 | }).listen(3000); 9 | --------------------------------------------------------------------------------