koa-classic-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +0 -0
- package/Readme.md +102 -0
- package/index.js +272 -0
- package/package.json +20 -0
- package/test/node_modules/.package-lock.json +1254 -0
- package/test/node_modules/abbrev/LICENSE +46 -0
- package/test/node_modules/abbrev/README.md +23 -0
- package/test/node_modules/abbrev/abbrev.js +61 -0
- package/test/node_modules/abbrev/package.json +21 -0
- package/test/node_modules/accepts/HISTORY.md +243 -0
- package/test/node_modules/accepts/LICENSE +23 -0
- package/test/node_modules/accepts/README.md +140 -0
- package/test/node_modules/accepts/index.js +238 -0
- package/test/node_modules/accepts/package.json +47 -0
- package/test/node_modules/ansi-styles/index.d.ts +345 -0
- package/test/node_modules/ansi-styles/index.js +163 -0
- package/test/node_modules/ansi-styles/license +9 -0
- package/test/node_modules/ansi-styles/package.json +56 -0
- package/test/node_modules/ansi-styles/readme.md +152 -0
- package/test/node_modules/any-promise/.jshintrc +4 -0
- package/test/node_modules/any-promise/LICENSE +19 -0
- package/test/node_modules/any-promise/README.md +161 -0
- package/test/node_modules/any-promise/implementation.d.ts +3 -0
- package/test/node_modules/any-promise/implementation.js +1 -0
- package/test/node_modules/any-promise/index.d.ts +73 -0
- package/test/node_modules/any-promise/index.js +1 -0
- package/test/node_modules/any-promise/loader.js +78 -0
- package/test/node_modules/any-promise/optional.js +6 -0
- package/test/node_modules/any-promise/package.json +45 -0
- package/test/node_modules/any-promise/register/bluebird.d.ts +1 -0
- package/test/node_modules/any-promise/register/bluebird.js +2 -0
- package/test/node_modules/any-promise/register/es6-promise.d.ts +1 -0
- package/test/node_modules/any-promise/register/es6-promise.js +2 -0
- package/test/node_modules/any-promise/register/lie.d.ts +1 -0
- package/test/node_modules/any-promise/register/lie.js +2 -0
- package/test/node_modules/any-promise/register/native-promise-only.d.ts +1 -0
- package/test/node_modules/any-promise/register/native-promise-only.js +2 -0
- package/test/node_modules/any-promise/register/pinkie.d.ts +1 -0
- package/test/node_modules/any-promise/register/pinkie.js +2 -0
- package/test/node_modules/any-promise/register/promise.d.ts +1 -0
- package/test/node_modules/any-promise/register/promise.js +2 -0
- package/test/node_modules/any-promise/register/q.d.ts +1 -0
- package/test/node_modules/any-promise/register/q.js +2 -0
- package/test/node_modules/any-promise/register/rsvp.d.ts +1 -0
- package/test/node_modules/any-promise/register/rsvp.js +2 -0
- package/test/node_modules/any-promise/register/vow.d.ts +1 -0
- package/test/node_modules/any-promise/register/vow.js +2 -0
- package/test/node_modules/any-promise/register/when.d.ts +1 -0
- package/test/node_modules/any-promise/register/when.js +2 -0
- package/test/node_modules/any-promise/register-shim.js +18 -0
- package/test/node_modules/any-promise/register.d.ts +17 -0
- package/test/node_modules/any-promise/register.js +94 -0
- package/test/node_modules/anymatch/LICENSE +15 -0
- package/test/node_modules/anymatch/README.md +87 -0
- package/test/node_modules/anymatch/index.d.ts +20 -0
- package/test/node_modules/anymatch/index.js +104 -0
- package/test/node_modules/anymatch/package.json +48 -0
- package/test/node_modules/async/CHANGELOG.md +348 -0
- package/test/node_modules/async/LICENSE +19 -0
- package/test/node_modules/async/README.md +59 -0
- package/test/node_modules/async/all.js +119 -0
- package/test/node_modules/async/allLimit.js +46 -0
- package/test/node_modules/async/allSeries.js +45 -0
- package/test/node_modules/async/any.js +122 -0
- package/test/node_modules/async/anyLimit.js +47 -0
- package/test/node_modules/async/anySeries.js +46 -0
- package/test/node_modules/async/apply.js +55 -0
- package/test/node_modules/async/applyEach.js +57 -0
- package/test/node_modules/async/applyEachSeries.js +37 -0
- package/test/node_modules/async/asyncify.js +118 -0
- package/test/node_modules/async/auto.js +333 -0
- package/test/node_modules/async/autoInject.js +182 -0
- package/test/node_modules/async/bower.json +17 -0
- package/test/node_modules/async/cargo.js +63 -0
- package/test/node_modules/async/cargoQueue.js +71 -0
- package/test/node_modules/async/compose.js +55 -0
- package/test/node_modules/async/concat.js +115 -0
- package/test/node_modules/async/concatLimit.js +60 -0
- package/test/node_modules/async/concatSeries.js +41 -0
- package/test/node_modules/async/constant.js +55 -0
- package/test/node_modules/async/detect.js +96 -0
- package/test/node_modules/async/detectLimit.js +48 -0
- package/test/node_modules/async/detectSeries.js +47 -0
- package/test/node_modules/async/dir.js +43 -0
- package/test/node_modules/async/dist/async.js +6059 -0
- package/test/node_modules/async/dist/async.min.js +1 -0
- package/test/node_modules/async/dist/async.mjs +5947 -0
- package/test/node_modules/async/doDuring.js +68 -0
- package/test/node_modules/async/doUntil.js +46 -0
- package/test/node_modules/async/doWhilst.js +68 -0
- package/test/node_modules/async/during.js +78 -0
- package/test/node_modules/async/each.js +129 -0
- package/test/node_modules/async/eachLimit.js +50 -0
- package/test/node_modules/async/eachOf.js +185 -0
- package/test/node_modules/async/eachOfLimit.js +47 -0
- package/test/node_modules/async/eachOfSeries.js +39 -0
- package/test/node_modules/async/eachSeries.js +44 -0
- package/test/node_modules/async/ensureAsync.js +67 -0
- package/test/node_modules/async/every.js +119 -0
- package/test/node_modules/async/everyLimit.js +46 -0
- package/test/node_modules/async/everySeries.js +45 -0
- package/test/node_modules/async/filter.js +93 -0
- package/test/node_modules/async/filterLimit.js +45 -0
- package/test/node_modules/async/filterSeries.js +43 -0
- package/test/node_modules/async/find.js +96 -0
- package/test/node_modules/async/findLimit.js +48 -0
- package/test/node_modules/async/findSeries.js +47 -0
- package/test/node_modules/async/flatMap.js +115 -0
- package/test/node_modules/async/flatMapLimit.js +60 -0
- package/test/node_modules/async/flatMapSeries.js +41 -0
- package/test/node_modules/async/foldl.js +153 -0
- package/test/node_modules/async/foldr.js +41 -0
- package/test/node_modules/async/forEach.js +129 -0
- package/test/node_modules/async/forEachLimit.js +50 -0
- package/test/node_modules/async/forEachOf.js +185 -0
- package/test/node_modules/async/forEachOfLimit.js +47 -0
- package/test/node_modules/async/forEachOfSeries.js +39 -0
- package/test/node_modules/async/forEachSeries.js +44 -0
- package/test/node_modules/async/forever.js +68 -0
- package/test/node_modules/async/groupBy.js +108 -0
- package/test/node_modules/async/groupByLimit.js +71 -0
- package/test/node_modules/async/groupBySeries.js +36 -0
- package/test/node_modules/async/index.js +588 -0
- package/test/node_modules/async/inject.js +153 -0
- package/test/node_modules/async/internal/DoublyLinkedList.js +92 -0
- package/test/node_modules/async/internal/Heap.js +120 -0
- package/test/node_modules/async/internal/applyEach.js +29 -0
- package/test/node_modules/async/internal/asyncEachOfLimit.js +75 -0
- package/test/node_modules/async/internal/awaitify.js +27 -0
- package/test/node_modules/async/internal/breakLoop.js +10 -0
- package/test/node_modules/async/internal/consoleFunc.js +31 -0
- package/test/node_modules/async/internal/createTester.js +40 -0
- package/test/node_modules/async/internal/eachOfLimit.js +90 -0
- package/test/node_modules/async/internal/filter.js +55 -0
- package/test/node_modules/async/internal/getIterator.js +11 -0
- package/test/node_modules/async/internal/initialParams.js +14 -0
- package/test/node_modules/async/internal/isArrayLike.js +10 -0
- package/test/node_modules/async/internal/iterator.js +57 -0
- package/test/node_modules/async/internal/map.js +30 -0
- package/test/node_modules/async/internal/once.js +17 -0
- package/test/node_modules/async/internal/onlyOnce.js +15 -0
- package/test/node_modules/async/internal/parallel.js +34 -0
- package/test/node_modules/async/internal/promiseCallback.js +23 -0
- package/test/node_modules/async/internal/queue.js +294 -0
- package/test/node_modules/async/internal/range.js +14 -0
- package/test/node_modules/async/internal/reject.js +26 -0
- package/test/node_modules/async/internal/setImmediate.js +34 -0
- package/test/node_modules/async/internal/withoutIndex.js +10 -0
- package/test/node_modules/async/internal/wrapAsync.js +34 -0
- package/test/node_modules/async/log.js +41 -0
- package/test/node_modules/async/map.js +142 -0
- package/test/node_modules/async/mapLimit.js +45 -0
- package/test/node_modules/async/mapSeries.js +44 -0
- package/test/node_modules/async/mapValues.js +152 -0
- package/test/node_modules/async/mapValuesLimit.js +61 -0
- package/test/node_modules/async/mapValuesSeries.js +37 -0
- package/test/node_modules/async/memoize.js +91 -0
- package/test/node_modules/async/nextTick.js +52 -0
- package/test/node_modules/async/package.json +75 -0
- package/test/node_modules/async/parallel.js +180 -0
- package/test/node_modules/async/parallelLimit.js +41 -0
- package/test/node_modules/async/priorityQueue.js +86 -0
- package/test/node_modules/async/queue.js +167 -0
- package/test/node_modules/async/race.js +67 -0
- package/test/node_modules/async/reduce.js +153 -0
- package/test/node_modules/async/reduceRight.js +41 -0
- package/test/node_modules/async/reflect.js +78 -0
- package/test/node_modules/async/reflectAll.js +93 -0
- package/test/node_modules/async/reject.js +87 -0
- package/test/node_modules/async/rejectLimit.js +45 -0
- package/test/node_modules/async/rejectSeries.js +43 -0
- package/test/node_modules/async/retry.js +159 -0
- package/test/node_modules/async/retryable.js +77 -0
- package/test/node_modules/async/select.js +93 -0
- package/test/node_modules/async/selectLimit.js +45 -0
- package/test/node_modules/async/selectSeries.js +43 -0
- package/test/node_modules/async/seq.js +79 -0
- package/test/node_modules/async/series.js +186 -0
- package/test/node_modules/async/setImmediate.js +45 -0
- package/test/node_modules/async/some.js +122 -0
- package/test/node_modules/async/someLimit.js +47 -0
- package/test/node_modules/async/someSeries.js +46 -0
- package/test/node_modules/async/sortBy.js +190 -0
- package/test/node_modules/async/timeout.js +89 -0
- package/test/node_modules/async/times.js +50 -0
- package/test/node_modules/async/timesLimit.js +43 -0
- package/test/node_modules/async/timesSeries.js +32 -0
- package/test/node_modules/async/transform.js +173 -0
- package/test/node_modules/async/tryEach.js +78 -0
- package/test/node_modules/async/unmemoize.js +25 -0
- package/test/node_modules/async/until.js +61 -0
- package/test/node_modules/async/waterfall.js +105 -0
- package/test/node_modules/async/whilst.js +78 -0
- package/test/node_modules/async/wrapSync.js +118 -0
- package/test/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/test/node_modules/balanced-match/LICENSE.md +21 -0
- package/test/node_modules/balanced-match/README.md +97 -0
- package/test/node_modules/balanced-match/index.js +62 -0
- package/test/node_modules/balanced-match/package.json +48 -0
- package/test/node_modules/binary-extensions/binary-extensions.json +260 -0
- package/test/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
- package/test/node_modules/binary-extensions/index.d.ts +14 -0
- package/test/node_modules/binary-extensions/index.js +1 -0
- package/test/node_modules/binary-extensions/license +9 -0
- package/test/node_modules/binary-extensions/package.json +38 -0
- package/test/node_modules/binary-extensions/readme.md +41 -0
- package/test/node_modules/bluebird/LICENSE +21 -0
- package/test/node_modules/bluebird/README.md +57 -0
- package/test/node_modules/bluebird/changelog.md +1 -0
- package/test/node_modules/bluebird/js/browser/bluebird.core.js +3914 -0
- package/test/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
- package/test/node_modules/bluebird/js/browser/bluebird.js +5778 -0
- package/test/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
- package/test/node_modules/bluebird/js/release/any.js +21 -0
- package/test/node_modules/bluebird/js/release/assert.js +55 -0
- package/test/node_modules/bluebird/js/release/async.js +120 -0
- package/test/node_modules/bluebird/js/release/bind.js +67 -0
- package/test/node_modules/bluebird/js/release/bluebird.js +11 -0
- package/test/node_modules/bluebird/js/release/call_get.js +123 -0
- package/test/node_modules/bluebird/js/release/cancel.js +129 -0
- package/test/node_modules/bluebird/js/release/catch_filter.js +42 -0
- package/test/node_modules/bluebird/js/release/context.js +69 -0
- package/test/node_modules/bluebird/js/release/debuggability.js +1009 -0
- package/test/node_modules/bluebird/js/release/direct_resolve.js +46 -0
- package/test/node_modules/bluebird/js/release/each.js +30 -0
- package/test/node_modules/bluebird/js/release/errors.js +116 -0
- package/test/node_modules/bluebird/js/release/es5.js +80 -0
- package/test/node_modules/bluebird/js/release/filter.js +12 -0
- package/test/node_modules/bluebird/js/release/finally.js +146 -0
- package/test/node_modules/bluebird/js/release/generators.js +223 -0
- package/test/node_modules/bluebird/js/release/join.js +165 -0
- package/test/node_modules/bluebird/js/release/map.js +175 -0
- package/test/node_modules/bluebird/js/release/method.js +55 -0
- package/test/node_modules/bluebird/js/release/nodeback.js +51 -0
- package/test/node_modules/bluebird/js/release/nodeify.js +58 -0
- package/test/node_modules/bluebird/js/release/promise.js +819 -0
- package/test/node_modules/bluebird/js/release/promise_array.js +186 -0
- package/test/node_modules/bluebird/js/release/promisify.js +314 -0
- package/test/node_modules/bluebird/js/release/props.js +118 -0
- package/test/node_modules/bluebird/js/release/queue.js +73 -0
- package/test/node_modules/bluebird/js/release/race.js +49 -0
- package/test/node_modules/bluebird/js/release/reduce.js +183 -0
- package/test/node_modules/bluebird/js/release/schedule.js +62 -0
- package/test/node_modules/bluebird/js/release/settle.js +47 -0
- package/test/node_modules/bluebird/js/release/some.js +148 -0
- package/test/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
- package/test/node_modules/bluebird/js/release/thenables.js +86 -0
- package/test/node_modules/bluebird/js/release/timers.js +93 -0
- package/test/node_modules/bluebird/js/release/using.js +226 -0
- package/test/node_modules/bluebird/js/release/util.js +421 -0
- package/test/node_modules/bluebird/package.json +78 -0
- package/test/node_modules/brace-expansion/LICENSE +21 -0
- package/test/node_modules/brace-expansion/README.md +129 -0
- package/test/node_modules/brace-expansion/index.js +201 -0
- package/test/node_modules/brace-expansion/package.json +47 -0
- package/test/node_modules/braces/CHANGELOG.md +184 -0
- package/test/node_modules/braces/LICENSE +21 -0
- package/test/node_modules/braces/README.md +593 -0
- package/test/node_modules/braces/index.js +170 -0
- package/test/node_modules/braces/lib/compile.js +57 -0
- package/test/node_modules/braces/lib/constants.js +57 -0
- package/test/node_modules/braces/lib/expand.js +113 -0
- package/test/node_modules/braces/lib/parse.js +333 -0
- package/test/node_modules/braces/lib/stringify.js +32 -0
- package/test/node_modules/braces/lib/utils.js +112 -0
- package/test/node_modules/braces/package.json +77 -0
- package/test/node_modules/cache-content-type/History.md +15 -0
- package/test/node_modules/cache-content-type/README.md +17 -0
- package/test/node_modules/cache-content-type/index.js +15 -0
- package/test/node_modules/cache-content-type/package.json +42 -0
- package/test/node_modules/chalk/index.d.ts +415 -0
- package/test/node_modules/chalk/license +9 -0
- package/test/node_modules/chalk/package.json +68 -0
- package/test/node_modules/chalk/readme.md +341 -0
- package/test/node_modules/chalk/source/index.js +229 -0
- package/test/node_modules/chalk/source/templates.js +134 -0
- package/test/node_modules/chalk/source/util.js +39 -0
- package/test/node_modules/chokidar/LICENSE +21 -0
- package/test/node_modules/chokidar/README.md +308 -0
- package/test/node_modules/chokidar/index.js +973 -0
- package/test/node_modules/chokidar/lib/constants.js +65 -0
- package/test/node_modules/chokidar/lib/fsevents-handler.js +524 -0
- package/test/node_modules/chokidar/lib/nodefs-handler.js +654 -0
- package/test/node_modules/chokidar/package.json +85 -0
- package/test/node_modules/chokidar/types/index.d.ts +188 -0
- package/test/node_modules/co/History.md +172 -0
- package/test/node_modules/co/LICENSE +22 -0
- package/test/node_modules/co/Readme.md +212 -0
- package/test/node_modules/co/index.js +237 -0
- package/test/node_modules/co/package.json +34 -0
- package/test/node_modules/color-convert/CHANGELOG.md +54 -0
- package/test/node_modules/color-convert/LICENSE +21 -0
- package/test/node_modules/color-convert/README.md +68 -0
- package/test/node_modules/color-convert/conversions.js +839 -0
- package/test/node_modules/color-convert/index.js +81 -0
- package/test/node_modules/color-convert/package.json +48 -0
- package/test/node_modules/color-convert/route.js +97 -0
- package/test/node_modules/color-name/LICENSE +8 -0
- package/test/node_modules/color-name/README.md +11 -0
- package/test/node_modules/color-name/index.js +152 -0
- package/test/node_modules/color-name/package.json +28 -0
- package/test/node_modules/commander/CHANGELOG.md +419 -0
- package/test/node_modules/commander/LICENSE +22 -0
- package/test/node_modules/commander/Readme.md +428 -0
- package/test/node_modules/commander/index.js +1224 -0
- package/test/node_modules/commander/package.json +38 -0
- package/test/node_modules/commander/typings/index.d.ts +310 -0
- package/test/node_modules/concat-map/.travis.yml +4 -0
- package/test/node_modules/concat-map/LICENSE +18 -0
- package/test/node_modules/concat-map/README.markdown +62 -0
- package/test/node_modules/concat-map/example/map.js +6 -0
- package/test/node_modules/concat-map/index.js +13 -0
- package/test/node_modules/concat-map/package.json +43 -0
- package/test/node_modules/concat-map/test/map.js +39 -0
- package/test/node_modules/condense-newlines/LICENSE +21 -0
- package/test/node_modules/condense-newlines/README.md +105 -0
- package/test/node_modules/condense-newlines/index.js +60 -0
- package/test/node_modules/condense-newlines/package.json +64 -0
- package/test/node_modules/config-chain/LICENCE +22 -0
- package/test/node_modules/config-chain/index.js +282 -0
- package/test/node_modules/config-chain/package.json +28 -0
- package/test/node_modules/config-chain/readme.markdown +257 -0
- package/test/node_modules/consolidate/History.md +132 -0
- package/test/node_modules/consolidate/Readme.md +223 -0
- package/test/node_modules/consolidate/index.js +1 -0
- package/test/node_modules/consolidate/lib/consolidate.js +1792 -0
- package/test/node_modules/consolidate/package.json +94 -0
- package/test/node_modules/content-disposition/HISTORY.md +60 -0
- package/test/node_modules/content-disposition/LICENSE +22 -0
- package/test/node_modules/content-disposition/README.md +142 -0
- package/test/node_modules/content-disposition/index.js +458 -0
- package/test/node_modules/content-disposition/package.json +44 -0
- package/test/node_modules/content-type/HISTORY.md +24 -0
- package/test/node_modules/content-type/LICENSE +22 -0
- package/test/node_modules/content-type/README.md +92 -0
- package/test/node_modules/content-type/index.js +222 -0
- package/test/node_modules/content-type/package.json +40 -0
- package/test/node_modules/cookies/HISTORY.md +121 -0
- package/test/node_modules/cookies/LICENSE +23 -0
- package/test/node_modules/cookies/README.md +145 -0
- package/test/node_modules/cookies/index.js +224 -0
- package/test/node_modules/cookies/package.json +38 -0
- package/test/node_modules/debug/LICENSE +20 -0
- package/test/node_modules/debug/README.md +481 -0
- package/test/node_modules/debug/package.json +59 -0
- package/test/node_modules/debug/src/browser.js +269 -0
- package/test/node_modules/debug/src/common.js +274 -0
- package/test/node_modules/debug/src/index.js +10 -0
- package/test/node_modules/debug/src/node.js +263 -0
- package/test/node_modules/deep-equal/.travis.yml +8 -0
- package/test/node_modules/deep-equal/LICENSE +18 -0
- package/test/node_modules/deep-equal/example/cmp.js +11 -0
- package/test/node_modules/deep-equal/index.js +94 -0
- package/test/node_modules/deep-equal/lib/is_arguments.js +20 -0
- package/test/node_modules/deep-equal/lib/keys.js +9 -0
- package/test/node_modules/deep-equal/package.json +58 -0
- package/test/node_modules/deep-equal/readme.markdown +61 -0
- package/test/node_modules/deep-equal/test/cmp.js +95 -0
- package/test/node_modules/delegates/History.md +22 -0
- package/test/node_modules/delegates/License +20 -0
- package/test/node_modules/delegates/Makefile +8 -0
- package/test/node_modules/delegates/Readme.md +94 -0
- package/test/node_modules/delegates/index.js +121 -0
- package/test/node_modules/delegates/package.json +13 -0
- package/test/node_modules/delegates/test/index.js +94 -0
- package/test/node_modules/depd/History.md +103 -0
- package/test/node_modules/depd/LICENSE +22 -0
- package/test/node_modules/depd/Readme.md +280 -0
- package/test/node_modules/depd/index.js +538 -0
- package/test/node_modules/depd/lib/browser/index.js +77 -0
- package/test/node_modules/depd/package.json +45 -0
- package/test/node_modules/destroy/LICENSE +23 -0
- package/test/node_modules/destroy/README.md +63 -0
- package/test/node_modules/destroy/index.js +209 -0
- package/test/node_modules/destroy/package.json +48 -0
- package/test/node_modules/editorconfig/CHANGELOG.md +14 -0
- package/test/node_modules/editorconfig/LICENSE +19 -0
- package/test/node_modules/editorconfig/README.md +206 -0
- package/test/node_modules/editorconfig/bin/editorconfig +3 -0
- package/test/node_modules/editorconfig/package.json +59 -0
- package/test/node_modules/editorconfig/src/cli.d.ts +1 -0
- package/test/node_modules/editorconfig/src/cli.js +53 -0
- package/test/node_modules/editorconfig/src/index.d.ts +29 -0
- package/test/node_modules/editorconfig/src/index.js +261 -0
- package/test/node_modules/editorconfig/src/lib/fnmatch.d.ts +214 -0
- package/test/node_modules/editorconfig/src/lib/fnmatch.js +1047 -0
- package/test/node_modules/editorconfig/src/lib/ini.d.ts +14 -0
- package/test/node_modules/editorconfig/src/lib/ini.js +106 -0
- package/test/node_modules/ee-first/LICENSE +22 -0
- package/test/node_modules/ee-first/README.md +80 -0
- package/test/node_modules/ee-first/index.js +95 -0
- package/test/node_modules/ee-first/package.json +29 -0
- package/test/node_modules/ejs/LICENSE +202 -0
- package/test/node_modules/ejs/README.md +344 -0
- package/test/node_modules/ejs/bin/cli.js +212 -0
- package/test/node_modules/ejs/ejs.js +1720 -0
- package/test/node_modules/ejs/ejs.min.js +1 -0
- package/test/node_modules/ejs/jakefile.js +88 -0
- package/test/node_modules/ejs/lib/ejs.js +951 -0
- package/test/node_modules/ejs/lib/utils.js +225 -0
- package/test/node_modules/ejs/package.json +42 -0
- package/test/node_modules/ejs/usage.txt +24 -0
- package/test/node_modules/encodeurl/HISTORY.md +14 -0
- package/test/node_modules/encodeurl/LICENSE +22 -0
- package/test/node_modules/encodeurl/README.md +128 -0
- package/test/node_modules/encodeurl/index.js +60 -0
- package/test/node_modules/encodeurl/package.json +40 -0
- package/test/node_modules/escape-html/LICENSE +24 -0
- package/test/node_modules/escape-html/Readme.md +43 -0
- package/test/node_modules/escape-html/index.js +78 -0
- package/test/node_modules/escape-html/package.json +24 -0
- package/test/node_modules/extend-shallow/LICENSE +21 -0
- package/test/node_modules/extend-shallow/README.md +61 -0
- package/test/node_modules/extend-shallow/index.js +33 -0
- package/test/node_modules/extend-shallow/package.json +56 -0
- package/test/node_modules/filelist/README.md +84 -0
- package/test/node_modules/filelist/index.d.ts +110 -0
- package/test/node_modules/filelist/index.js +495 -0
- package/test/node_modules/filelist/jakefile.js +15 -0
- package/test/node_modules/filelist/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
- package/test/node_modules/filelist/node_modules/brace-expansion/LICENSE +21 -0
- package/test/node_modules/filelist/node_modules/brace-expansion/README.md +135 -0
- package/test/node_modules/filelist/node_modules/brace-expansion/index.js +203 -0
- package/test/node_modules/filelist/node_modules/brace-expansion/package.json +46 -0
- package/test/node_modules/filelist/node_modules/minimatch/LICENSE +15 -0
- package/test/node_modules/filelist/node_modules/minimatch/README.md +259 -0
- package/test/node_modules/filelist/node_modules/minimatch/lib/path.js +4 -0
- package/test/node_modules/filelist/node_modules/minimatch/minimatch.js +906 -0
- package/test/node_modules/filelist/node_modules/minimatch/package.json +32 -0
- package/test/node_modules/filelist/package.json +28 -0
- package/test/node_modules/fill-range/LICENSE +21 -0
- package/test/node_modules/fill-range/README.md +237 -0
- package/test/node_modules/fill-range/index.js +249 -0
- package/test/node_modules/fill-range/package.json +69 -0
- package/test/node_modules/fresh/HISTORY.md +70 -0
- package/test/node_modules/fresh/LICENSE +23 -0
- package/test/node_modules/fresh/README.md +119 -0
- package/test/node_modules/fresh/index.js +137 -0
- package/test/node_modules/fresh/package.json +46 -0
- package/test/node_modules/fs.realpath/LICENSE +43 -0
- package/test/node_modules/fs.realpath/README.md +33 -0
- package/test/node_modules/fs.realpath/index.js +66 -0
- package/test/node_modules/fs.realpath/old.js +303 -0
- package/test/node_modules/fs.realpath/package.json +26 -0
- package/test/node_modules/get-paths/.editorconfig +9 -0
- package/test/node_modules/get-paths/.gitattributes +1 -0
- package/test/node_modules/get-paths/.lib.eslintrc +3 -0
- package/test/node_modules/get-paths/.remarkignore +1 -0
- package/test/node_modules/get-paths/.travis.yml +6 -0
- package/test/node_modules/get-paths/LICENSE +21 -0
- package/test/node_modules/get-paths/README.md +61 -0
- package/test/node_modules/get-paths/index.js +31 -0
- package/test/node_modules/get-paths/package.json +100 -0
- package/test/node_modules/get-paths/test/test.js +7 -0
- package/test/node_modules/glob/LICENSE +15 -0
- package/test/node_modules/glob/README.md +378 -0
- package/test/node_modules/glob/common.js +240 -0
- package/test/node_modules/glob/glob.js +790 -0
- package/test/node_modules/glob/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
- package/test/node_modules/glob/node_modules/brace-expansion/LICENSE +21 -0
- package/test/node_modules/glob/node_modules/brace-expansion/README.md +135 -0
- package/test/node_modules/glob/node_modules/brace-expansion/index.js +203 -0
- package/test/node_modules/glob/node_modules/brace-expansion/package.json +46 -0
- package/test/node_modules/glob/node_modules/minimatch/LICENSE +15 -0
- package/test/node_modules/glob/node_modules/minimatch/README.md +259 -0
- package/test/node_modules/glob/node_modules/minimatch/lib/path.js +4 -0
- package/test/node_modules/glob/node_modules/minimatch/minimatch.js +906 -0
- package/test/node_modules/glob/node_modules/minimatch/package.json +32 -0
- package/test/node_modules/glob/package.json +55 -0
- package/test/node_modules/glob/sync.js +486 -0
- package/test/node_modules/glob-parent/CHANGELOG.md +110 -0
- package/test/node_modules/glob-parent/LICENSE +15 -0
- package/test/node_modules/glob-parent/README.md +137 -0
- package/test/node_modules/glob-parent/index.js +42 -0
- package/test/node_modules/glob-parent/package.json +48 -0
- package/test/node_modules/has-flag/index.d.ts +39 -0
- package/test/node_modules/has-flag/index.js +8 -0
- package/test/node_modules/has-flag/license +9 -0
- package/test/node_modules/has-flag/package.json +46 -0
- package/test/node_modules/has-flag/readme.md +89 -0
- package/test/node_modules/has-symbols/.eslintrc +11 -0
- package/test/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/test/node_modules/has-symbols/.nycrc +9 -0
- package/test/node_modules/has-symbols/CHANGELOG.md +75 -0
- package/test/node_modules/has-symbols/LICENSE +21 -0
- package/test/node_modules/has-symbols/README.md +46 -0
- package/test/node_modules/has-symbols/index.js +13 -0
- package/test/node_modules/has-symbols/package.json +101 -0
- package/test/node_modules/has-symbols/shams.js +42 -0
- package/test/node_modules/has-symbols/test/index.js +22 -0
- package/test/node_modules/has-symbols/test/shams/core-js.js +28 -0
- package/test/node_modules/has-symbols/test/shams/get-own-property-symbols.js +28 -0
- package/test/node_modules/has-symbols/test/tests.js +56 -0
- package/test/node_modules/has-tostringtag/.eslintrc +11 -0
- package/test/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/test/node_modules/has-tostringtag/CHANGELOG.md +20 -0
- package/test/node_modules/has-tostringtag/LICENSE +21 -0
- package/test/node_modules/has-tostringtag/README.md +46 -0
- package/test/node_modules/has-tostringtag/index.js +7 -0
- package/test/node_modules/has-tostringtag/package.json +84 -0
- package/test/node_modules/has-tostringtag/shams.js +7 -0
- package/test/node_modules/has-tostringtag/test/index.js +21 -0
- package/test/node_modules/has-tostringtag/test/shams/core-js.js +28 -0
- package/test/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +28 -0
- package/test/node_modules/has-tostringtag/test/tests.js +14 -0
- package/test/node_modules/http-assert/HISTORY.md +79 -0
- package/test/node_modules/http-assert/LICENSE +22 -0
- package/test/node_modules/http-assert/README.md +116 -0
- package/test/node_modules/http-assert/index.js +41 -0
- package/test/node_modules/http-assert/package.json +41 -0
- package/test/node_modules/http-errors/HISTORY.md +165 -0
- package/test/node_modules/http-errors/LICENSE +23 -0
- package/test/node_modules/http-errors/README.md +169 -0
- package/test/node_modules/http-errors/index.js +299 -0
- package/test/node_modules/http-errors/node_modules/depd/History.md +96 -0
- package/test/node_modules/http-errors/node_modules/depd/LICENSE +22 -0
- package/test/node_modules/http-errors/node_modules/depd/Readme.md +280 -0
- package/test/node_modules/http-errors/node_modules/depd/index.js +522 -0
- package/test/node_modules/http-errors/node_modules/depd/lib/browser/index.js +77 -0
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/callsite-tostring.js +103 -0
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/event-listener-count.js +22 -0
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/index.js +79 -0
- package/test/node_modules/http-errors/node_modules/depd/package.json +41 -0
- package/test/node_modules/http-errors/package.json +49 -0
- package/test/node_modules/ignore-by-default/LICENSE +14 -0
- package/test/node_modules/ignore-by-default/README.md +26 -0
- package/test/node_modules/ignore-by-default/index.js +12 -0
- package/test/node_modules/ignore-by-default/package.json +34 -0
- package/test/node_modules/inflight/LICENSE +15 -0
- package/test/node_modules/inflight/README.md +37 -0
- package/test/node_modules/inflight/inflight.js +54 -0
- package/test/node_modules/inflight/package.json +29 -0
- package/test/node_modules/inherits/LICENSE +16 -0
- package/test/node_modules/inherits/README.md +42 -0
- package/test/node_modules/inherits/inherits.js +9 -0
- package/test/node_modules/inherits/inherits_browser.js +27 -0
- package/test/node_modules/inherits/package.json +29 -0
- package/test/node_modules/ini/LICENSE +15 -0
- package/test/node_modules/ini/README.md +102 -0
- package/test/node_modules/ini/ini.js +206 -0
- package/test/node_modules/ini/package.json +33 -0
- package/test/node_modules/is-binary-path/index.d.ts +17 -0
- package/test/node_modules/is-binary-path/index.js +7 -0
- package/test/node_modules/is-binary-path/license +9 -0
- package/test/node_modules/is-binary-path/package.json +40 -0
- package/test/node_modules/is-binary-path/readme.md +34 -0
- package/test/node_modules/is-buffer/LICENSE +21 -0
- package/test/node_modules/is-buffer/README.md +53 -0
- package/test/node_modules/is-buffer/index.js +21 -0
- package/test/node_modules/is-buffer/package.json +51 -0
- package/test/node_modules/is-buffer/test/basic.js +24 -0
- package/test/node_modules/is-extendable/LICENSE +21 -0
- package/test/node_modules/is-extendable/README.md +72 -0
- package/test/node_modules/is-extendable/index.js +13 -0
- package/test/node_modules/is-extendable/package.json +51 -0
- package/test/node_modules/is-extglob/LICENSE +21 -0
- package/test/node_modules/is-extglob/README.md +107 -0
- package/test/node_modules/is-extglob/index.js +20 -0
- package/test/node_modules/is-extglob/package.json +69 -0
- package/test/node_modules/is-generator-function/.eslintignore +1 -0
- package/test/node_modules/is-generator-function/.eslintrc +9 -0
- package/test/node_modules/is-generator-function/.nvmrc +1 -0
- package/test/node_modules/is-generator-function/.nycrc +9 -0
- package/test/node_modules/is-generator-function/CHANGELOG.md +216 -0
- package/test/node_modules/is-generator-function/LICENSE +20 -0
- package/test/node_modules/is-generator-function/README.md +40 -0
- package/test/node_modules/is-generator-function/index.js +38 -0
- package/test/node_modules/is-generator-function/package.json +87 -0
- package/test/node_modules/is-generator-function/test/corejs.js +5 -0
- package/test/node_modules/is-generator-function/test/index.js +83 -0
- package/test/node_modules/is-generator-function/test/uglified.js +8 -0
- package/test/node_modules/is-glob/LICENSE +21 -0
- package/test/node_modules/is-glob/README.md +206 -0
- package/test/node_modules/is-glob/index.js +150 -0
- package/test/node_modules/is-glob/package.json +81 -0
- package/test/node_modules/is-number/LICENSE +21 -0
- package/test/node_modules/is-number/README.md +187 -0
- package/test/node_modules/is-number/index.js +18 -0
- package/test/node_modules/is-number/package.json +82 -0
- package/test/node_modules/is-whitespace/LICENSE +21 -0
- package/test/node_modules/is-whitespace/README.md +47 -0
- package/test/node_modules/is-whitespace/index.js +19 -0
- package/test/node_modules/is-whitespace/package.json +47 -0
- package/test/node_modules/jake/Makefile +44 -0
- package/test/node_modules/jake/README.md +17 -0
- package/test/node_modules/jake/bin/bash_completion.sh +41 -0
- package/test/node_modules/jake/bin/cli.js +31 -0
- package/test/node_modules/jake/jakefile.js +94 -0
- package/test/node_modules/jake/lib/api.js +409 -0
- package/test/node_modules/jake/lib/jake.js +330 -0
- package/test/node_modules/jake/lib/loader.js +173 -0
- package/test/node_modules/jake/lib/namespace.js +115 -0
- package/test/node_modules/jake/lib/package_task.js +406 -0
- package/test/node_modules/jake/lib/parseargs.js +134 -0
- package/test/node_modules/jake/lib/program.js +282 -0
- package/test/node_modules/jake/lib/publish_task.js +290 -0
- package/test/node_modules/jake/lib/rule.js +311 -0
- package/test/node_modules/jake/lib/task/directory_task.js +30 -0
- package/test/node_modules/jake/lib/task/file_task.js +124 -0
- package/test/node_modules/jake/lib/task/index.js +9 -0
- package/test/node_modules/jake/lib/task/task.js +449 -0
- package/test/node_modules/jake/lib/test_task.js +270 -0
- package/test/node_modules/jake/lib/utils/file.js +286 -0
- package/test/node_modules/jake/lib/utils/index.js +297 -0
- package/test/node_modules/jake/lib/utils/logger.js +24 -0
- package/test/node_modules/jake/package.json +42 -0
- package/test/node_modules/jake/test/integration/concurrent.js +45 -0
- package/test/node_modules/jake/test/integration/file.js +228 -0
- package/test/node_modules/jake/test/integration/file_task.js +126 -0
- package/test/node_modules/jake/test/integration/helpers.js +80 -0
- package/test/node_modules/jake/test/integration/jakefile.js +337 -0
- package/test/node_modules/jake/test/integration/jakelib/concurrent.jake.js +113 -0
- package/test/node_modules/jake/test/integration/jakelib/publish.jake.js +49 -0
- package/test/node_modules/jake/test/integration/jakelib/required_module.jake.js +10 -0
- package/test/node_modules/jake/test/integration/jakelib/rule.jake.js +222 -0
- package/test/node_modules/jake/test/integration/publish_task.js +27 -0
- package/test/node_modules/jake/test/integration/rule.js +217 -0
- package/test/node_modules/jake/test/integration/selfdep.js +42 -0
- package/test/node_modules/jake/test/integration/task_base.js +167 -0
- package/test/node_modules/jake/test/unit/jakefile.js +36 -0
- package/test/node_modules/jake/test/unit/namespace.js +77 -0
- package/test/node_modules/jake/test/unit/parseargs.js +169 -0
- package/test/node_modules/jake/usage.txt +16 -0
- package/test/node_modules/js-beautify/LICENSE +9 -0
- package/test/node_modules/js-beautify/README.md +435 -0
- package/test/node_modules/js-beautify/js/bin/css-beautify.js +4 -0
- package/test/node_modules/js-beautify/js/bin/html-beautify.js +4 -0
- package/test/node_modules/js-beautify/js/bin/js-beautify.js +4 -0
- package/test/node_modules/js-beautify/js/index.js +86 -0
- package/test/node_modules/js-beautify/js/lib/beautifier.js +5982 -0
- package/test/node_modules/js-beautify/js/lib/beautifier.min.js +2 -0
- package/test/node_modules/js-beautify/js/lib/beautify-css.js +1675 -0
- package/test/node_modules/js-beautify/js/lib/beautify-html.js +3136 -0
- package/test/node_modules/js-beautify/js/lib/beautify.js +4020 -0
- package/test/node_modules/js-beautify/js/lib/cli.js +705 -0
- package/test/node_modules/js-beautify/js/lib/unpackers/javascriptobfuscator_unpacker.js +132 -0
- package/test/node_modules/js-beautify/js/lib/unpackers/myobfuscate_unpacker.js +119 -0
- package/test/node_modules/js-beautify/js/lib/unpackers/p_a_c_k_e_r_unpacker.js +119 -0
- package/test/node_modules/js-beautify/js/lib/unpackers/urlencode_unpacker.js +104 -0
- package/test/node_modules/js-beautify/js/src/cli.js +705 -0
- package/test/node_modules/js-beautify/js/src/core/directives.js +62 -0
- package/test/node_modules/js-beautify/js/src/core/inputscanner.js +192 -0
- package/test/node_modules/js-beautify/js/src/core/options.js +193 -0
- package/test/node_modules/js-beautify/js/src/core/output.js +419 -0
- package/test/node_modules/js-beautify/js/src/core/pattern.js +94 -0
- package/test/node_modules/js-beautify/js/src/core/templatablepattern.js +211 -0
- package/test/node_modules/js-beautify/js/src/core/token.js +54 -0
- package/test/node_modules/js-beautify/js/src/core/tokenizer.js +140 -0
- package/test/node_modules/js-beautify/js/src/core/tokenstream.js +78 -0
- package/test/node_modules/js-beautify/js/src/core/whitespacepattern.js +105 -0
- package/test/node_modules/js-beautify/js/src/css/beautifier.js +529 -0
- package/test/node_modules/js-beautify/js/src/css/index.js +42 -0
- package/test/node_modules/js-beautify/js/src/css/options.js +56 -0
- package/test/node_modules/js-beautify/js/src/css/tokenizer.js +29 -0
- package/test/node_modules/js-beautify/js/src/html/beautifier.js +878 -0
- package/test/node_modules/js-beautify/js/src/html/index.js +42 -0
- package/test/node_modules/js-beautify/js/src/html/options.js +91 -0
- package/test/node_modules/js-beautify/js/src/html/tokenizer.js +332 -0
- package/test/node_modules/js-beautify/js/src/index.js +44 -0
- package/test/node_modules/js-beautify/js/src/javascript/acorn.js +57 -0
- package/test/node_modules/js-beautify/js/src/javascript/beautifier.js +1472 -0
- package/test/node_modules/js-beautify/js/src/javascript/index.js +42 -0
- package/test/node_modules/js-beautify/js/src/javascript/options.js +93 -0
- package/test/node_modules/js-beautify/js/src/javascript/tokenizer.js +567 -0
- package/test/node_modules/js-beautify/js/src/unpackers/javascriptobfuscator_unpacker.js +132 -0
- package/test/node_modules/js-beautify/js/src/unpackers/myobfuscate_unpacker.js +119 -0
- package/test/node_modules/js-beautify/js/src/unpackers/p_a_c_k_e_r_unpacker.js +119 -0
- package/test/node_modules/js-beautify/js/src/unpackers/urlencode_unpacker.js +104 -0
- package/test/node_modules/js-beautify/package.json +72 -0
- package/test/node_modules/keygrip/HISTORY.md +25 -0
- package/test/node_modules/keygrip/LICENSE +21 -0
- package/test/node_modules/keygrip/README.md +103 -0
- package/test/node_modules/keygrip/index.js +51 -0
- package/test/node_modules/keygrip/package.json +28 -0
- package/test/node_modules/kind-of/LICENSE +21 -0
- package/test/node_modules/kind-of/README.md +261 -0
- package/test/node_modules/kind-of/index.js +116 -0
- package/test/node_modules/kind-of/package.json +90 -0
- package/test/node_modules/koa/History.md +696 -0
- package/test/node_modules/koa/LICENSE +22 -0
- package/test/node_modules/koa/Readme.md +289 -0
- package/test/node_modules/koa/dist/koa.mjs +4 -0
- package/test/node_modules/koa/lib/application.js +314 -0
- package/test/node_modules/koa/lib/context.js +251 -0
- package/test/node_modules/koa/lib/request.js +726 -0
- package/test/node_modules/koa/lib/response.js +588 -0
- package/test/node_modules/koa/package.json +89 -0
- package/test/node_modules/koa-compose/History.md +60 -0
- package/test/node_modules/koa-compose/Readme.md +40 -0
- package/test/node_modules/koa-compose/index.js +48 -0
- package/test/node_modules/koa-compose/package.json +30 -0
- package/test/node_modules/koa-convert/LICENSE +22 -0
- package/test/node_modules/koa-convert/README.md +166 -0
- package/test/node_modules/koa-convert/index.js +105 -0
- package/test/node_modules/koa-convert/package.json +64 -0
- package/test/node_modules/koa-send/History.md +133 -0
- package/test/node_modules/koa-send/LICENSE +22 -0
- package/test/node_modules/koa-send/README.md +109 -0
- package/test/node_modules/koa-send/index.js +188 -0
- package/test/node_modules/koa-send/package.json +58 -0
- package/test/node_modules/koa-views/.eslintrc +14 -0
- package/test/node_modules/koa-views/.gitattributes +1 -0
- package/test/node_modules/koa-views/.github/workflows/test.yml +20 -0
- package/test/node_modules/koa-views/README.md +201 -0
- package/test/node_modules/koa-views/history.md +110 -0
- package/test/node_modules/koa-views/index.d.ts +62 -0
- package/test/node_modules/koa-views/license +22 -0
- package/test/node_modules/koa-views/package.json +68 -0
- package/test/node_modules/koa-views/src/index.js +98 -0
- package/test/node_modules/koa-views/test/.eslintrc +5 -0
- package/test/node_modules/koa-views/test/fixtures/basic.ejs +10 -0
- package/test/node_modules/koa-views/test/fixtures/basic.foo +1 -0
- package/test/node_modules/koa-views/test/fixtures/basic.html +11 -0
- package/test/node_modules/koa-views/test/fixtures/basic.pug +9 -0
- package/test/node_modules/koa-views/test/fixtures/basic.test.html +11 -0
- package/test/node_modules/koa-views/test/fixtures/global-state.pug +9 -0
- package/test/node_modules/koa-views/test/fixtures/index.html +10 -0
- package/test/node_modules/koa-views/test/fixtures/nunjucks-filter.html +11 -0
- package/test/node_modules/koa-views/test/fixtures/state.pug +9 -0
- package/test/node_modules/koa-views/test/fixtures/underscore.html +11 -0
- package/test/node_modules/koa-views/test/fixtures/view-options-partial.hbs +1 -0
- package/test/node_modules/koa-views/test/fixtures/view-options.hbs +4 -0
- package/test/node_modules/koa-views/test/index.js +431 -0
- package/test/node_modules/koa-views/test-outside/fixtures/basic.ejs +10 -0
- package/test/node_modules/lru-cache/LICENSE +15 -0
- package/test/node_modules/lru-cache/README.md +158 -0
- package/test/node_modules/lru-cache/index.js +468 -0
- package/test/node_modules/lru-cache/package.json +36 -0
- package/test/node_modules/media-typer/HISTORY.md +22 -0
- package/test/node_modules/media-typer/LICENSE +22 -0
- package/test/node_modules/media-typer/README.md +81 -0
- package/test/node_modules/media-typer/index.js +270 -0
- package/test/node_modules/media-typer/package.json +26 -0
- package/test/node_modules/mime-db/HISTORY.md +507 -0
- package/test/node_modules/mime-db/LICENSE +23 -0
- package/test/node_modules/mime-db/README.md +100 -0
- package/test/node_modules/mime-db/db.json +8519 -0
- package/test/node_modules/mime-db/index.js +12 -0
- package/test/node_modules/mime-db/package.json +60 -0
- package/test/node_modules/mime-types/HISTORY.md +397 -0
- package/test/node_modules/mime-types/LICENSE +23 -0
- package/test/node_modules/mime-types/README.md +113 -0
- package/test/node_modules/mime-types/index.js +188 -0
- package/test/node_modules/mime-types/package.json +44 -0
- package/test/node_modules/minimatch/LICENSE +15 -0
- package/test/node_modules/minimatch/README.md +230 -0
- package/test/node_modules/minimatch/minimatch.js +947 -0
- package/test/node_modules/minimatch/package.json +33 -0
- package/test/node_modules/ms/index.js +162 -0
- package/test/node_modules/ms/license.md +21 -0
- package/test/node_modules/ms/package.json +37 -0
- package/test/node_modules/ms/readme.md +60 -0
- package/test/node_modules/mz/HISTORY.md +66 -0
- package/test/node_modules/mz/LICENSE +22 -0
- package/test/node_modules/mz/README.md +106 -0
- package/test/node_modules/mz/child_process.js +8 -0
- package/test/node_modules/mz/crypto.js +9 -0
- package/test/node_modules/mz/dns.js +16 -0
- package/test/node_modules/mz/fs.js +62 -0
- package/test/node_modules/mz/index.js +8 -0
- package/test/node_modules/mz/package.json +44 -0
- package/test/node_modules/mz/readline.js +64 -0
- package/test/node_modules/mz/zlib.js +13 -0
- package/test/node_modules/negotiator/HISTORY.md +108 -0
- package/test/node_modules/negotiator/LICENSE +24 -0
- package/test/node_modules/negotiator/README.md +203 -0
- package/test/node_modules/negotiator/index.js +82 -0
- package/test/node_modules/negotiator/lib/charset.js +169 -0
- package/test/node_modules/negotiator/lib/encoding.js +184 -0
- package/test/node_modules/negotiator/lib/language.js +179 -0
- package/test/node_modules/negotiator/lib/mediaType.js +294 -0
- package/test/node_modules/negotiator/package.json +42 -0
- package/test/node_modules/nodemon/LICENSE +21 -0
- package/test/node_modules/nodemon/README.md +423 -0
- package/test/node_modules/nodemon/bin/nodemon.js +16 -0
- package/test/node_modules/nodemon/bin/windows-kill.exe +0 -0
- package/test/node_modules/nodemon/doc/cli/authors.txt +8 -0
- package/test/node_modules/nodemon/doc/cli/config.txt +44 -0
- package/test/node_modules/nodemon/doc/cli/help.txt +29 -0
- package/test/node_modules/nodemon/doc/cli/logo.txt +20 -0
- package/test/node_modules/nodemon/doc/cli/options.txt +36 -0
- package/test/node_modules/nodemon/doc/cli/topics.txt +8 -0
- package/test/node_modules/nodemon/doc/cli/usage.txt +3 -0
- package/test/node_modules/nodemon/doc/cli/whoami.txt +9 -0
- package/test/node_modules/nodemon/lib/cli/index.js +49 -0
- package/test/node_modules/nodemon/lib/cli/parse.js +230 -0
- package/test/node_modules/nodemon/lib/config/command.js +43 -0
- package/test/node_modules/nodemon/lib/config/defaults.js +28 -0
- package/test/node_modules/nodemon/lib/config/exec.js +225 -0
- package/test/node_modules/nodemon/lib/config/index.js +93 -0
- package/test/node_modules/nodemon/lib/config/load.js +256 -0
- package/test/node_modules/nodemon/lib/help/index.js +27 -0
- package/test/node_modules/nodemon/lib/index.js +1 -0
- package/test/node_modules/nodemon/lib/monitor/index.js +4 -0
- package/test/node_modules/nodemon/lib/monitor/match.js +276 -0
- package/test/node_modules/nodemon/lib/monitor/run.js +541 -0
- package/test/node_modules/nodemon/lib/monitor/signals.js +34 -0
- package/test/node_modules/nodemon/lib/monitor/watch.js +239 -0
- package/test/node_modules/nodemon/lib/nodemon.js +311 -0
- package/test/node_modules/nodemon/lib/rules/add.js +89 -0
- package/test/node_modules/nodemon/lib/rules/index.js +53 -0
- package/test/node_modules/nodemon/lib/rules/parse.js +43 -0
- package/test/node_modules/nodemon/lib/spawn.js +73 -0
- package/test/node_modules/nodemon/lib/utils/bus.js +44 -0
- package/test/node_modules/nodemon/lib/utils/clone.js +40 -0
- package/test/node_modules/nodemon/lib/utils/colour.js +26 -0
- package/test/node_modules/nodemon/lib/utils/index.js +102 -0
- package/test/node_modules/nodemon/lib/utils/log.js +82 -0
- package/test/node_modules/nodemon/lib/utils/merge.js +47 -0
- package/test/node_modules/nodemon/lib/version.js +100 -0
- package/test/node_modules/nodemon/node_modules/debug/CHANGELOG.md +395 -0
- package/test/node_modules/nodemon/node_modules/debug/LICENSE +19 -0
- package/test/node_modules/nodemon/node_modules/debug/README.md +437 -0
- package/test/node_modules/nodemon/node_modules/debug/node.js +1 -0
- package/test/node_modules/nodemon/node_modules/debug/package.json +51 -0
- package/test/node_modules/nodemon/node_modules/debug/src/browser.js +180 -0
- package/test/node_modules/nodemon/node_modules/debug/src/common.js +249 -0
- package/test/node_modules/nodemon/node_modules/debug/src/index.js +12 -0
- package/test/node_modules/nodemon/node_modules/debug/src/node.js +177 -0
- package/test/node_modules/nodemon/node_modules/has-flag/index.js +8 -0
- package/test/node_modules/nodemon/node_modules/has-flag/license +9 -0
- package/test/node_modules/nodemon/node_modules/has-flag/package.json +44 -0
- package/test/node_modules/nodemon/node_modules/has-flag/readme.md +70 -0
- package/test/node_modules/nodemon/node_modules/supports-color/browser.js +5 -0
- package/test/node_modules/nodemon/node_modules/supports-color/index.js +131 -0
- package/test/node_modules/nodemon/node_modules/supports-color/license +9 -0
- package/test/node_modules/nodemon/node_modules/supports-color/package.json +53 -0
- package/test/node_modules/nodemon/node_modules/supports-color/readme.md +66 -0
- package/test/node_modules/nodemon/package.json +74 -0
- package/test/node_modules/nopt/LICENSE +15 -0
- package/test/node_modules/nopt/README.md +213 -0
- package/test/node_modules/nopt/bin/nopt.js +56 -0
- package/test/node_modules/nopt/lib/nopt.js +515 -0
- package/test/node_modules/nopt/package.json +53 -0
- package/test/node_modules/normalize-path/LICENSE +21 -0
- package/test/node_modules/normalize-path/README.md +127 -0
- package/test/node_modules/normalize-path/index.js +35 -0
- package/test/node_modules/normalize-path/package.json +77 -0
- package/test/node_modules/object-assign/index.js +90 -0
- package/test/node_modules/object-assign/license +21 -0
- package/test/node_modules/object-assign/package.json +42 -0
- package/test/node_modules/object-assign/readme.md +61 -0
- package/test/node_modules/on-finished/HISTORY.md +98 -0
- package/test/node_modules/on-finished/LICENSE +23 -0
- package/test/node_modules/on-finished/README.md +162 -0
- package/test/node_modules/on-finished/index.js +234 -0
- package/test/node_modules/on-finished/package.json +39 -0
- package/test/node_modules/once/LICENSE +15 -0
- package/test/node_modules/once/README.md +79 -0
- package/test/node_modules/once/once.js +42 -0
- package/test/node_modules/once/package.json +33 -0
- package/test/node_modules/only/History.md +5 -0
- package/test/node_modules/only/Makefile +7 -0
- package/test/node_modules/only/Readme.md +58 -0
- package/test/node_modules/only/index.js +10 -0
- package/test/node_modules/only/package.json +14 -0
- package/test/node_modules/parseurl/HISTORY.md +58 -0
- package/test/node_modules/parseurl/LICENSE +24 -0
- package/test/node_modules/parseurl/README.md +133 -0
- package/test/node_modules/parseurl/index.js +158 -0
- package/test/node_modules/parseurl/package.json +40 -0
- package/test/node_modules/path-is-absolute/index.js +20 -0
- package/test/node_modules/path-is-absolute/license +21 -0
- package/test/node_modules/path-is-absolute/package.json +43 -0
- package/test/node_modules/path-is-absolute/readme.md +59 -0
- package/test/node_modules/picomatch/CHANGELOG.md +136 -0
- package/test/node_modules/picomatch/LICENSE +21 -0
- package/test/node_modules/picomatch/README.md +708 -0
- package/test/node_modules/picomatch/index.js +3 -0
- package/test/node_modules/picomatch/lib/constants.js +179 -0
- package/test/node_modules/picomatch/lib/parse.js +1091 -0
- package/test/node_modules/picomatch/lib/picomatch.js +342 -0
- package/test/node_modules/picomatch/lib/scan.js +391 -0
- package/test/node_modules/picomatch/lib/utils.js +64 -0
- package/test/node_modules/picomatch/package.json +81 -0
- package/test/node_modules/pify/index.js +68 -0
- package/test/node_modules/pify/license +9 -0
- package/test/node_modules/pify/package.json +51 -0
- package/test/node_modules/pify/readme.md +145 -0
- package/test/node_modules/pretty/LICENSE +21 -0
- package/test/node_modules/pretty/README.md +105 -0
- package/test/node_modules/pretty/index.js +45 -0
- package/test/node_modules/pretty/package.json +54 -0
- package/test/node_modules/proto-list/LICENSE +15 -0
- package/test/node_modules/proto-list/README.md +3 -0
- package/test/node_modules/proto-list/package.json +18 -0
- package/test/node_modules/proto-list/proto-list.js +88 -0
- package/test/node_modules/proto-list/test/basic.js +61 -0
- package/test/node_modules/pseudomap/LICENSE +15 -0
- package/test/node_modules/pseudomap/README.md +60 -0
- package/test/node_modules/pseudomap/map.js +9 -0
- package/test/node_modules/pseudomap/package.json +25 -0
- package/test/node_modules/pseudomap/pseudomap.js +113 -0
- package/test/node_modules/pseudomap/test/basic.js +86 -0
- package/test/node_modules/pstree.remy/.travis.yml +8 -0
- package/test/node_modules/pstree.remy/LICENSE +7 -0
- package/test/node_modules/pstree.remy/README.md +26 -0
- package/test/node_modules/pstree.remy/lib/index.js +37 -0
- package/test/node_modules/pstree.remy/lib/tree.js +37 -0
- package/test/node_modules/pstree.remy/lib/utils.js +53 -0
- package/test/node_modules/pstree.remy/package.json +33 -0
- package/test/node_modules/pstree.remy/tests/fixtures/index.js +13 -0
- package/test/node_modules/pstree.remy/tests/fixtures/out1 +10 -0
- package/test/node_modules/pstree.remy/tests/fixtures/out2 +29 -0
- package/test/node_modules/pstree.remy/tests/index.test.js +51 -0
- package/test/node_modules/readdirp/LICENSE +21 -0
- package/test/node_modules/readdirp/README.md +122 -0
- package/test/node_modules/readdirp/index.d.ts +43 -0
- package/test/node_modules/readdirp/index.js +287 -0
- package/test/node_modules/readdirp/package.json +122 -0
- package/test/node_modules/resolve-path/HISTORY.md +66 -0
- package/test/node_modules/resolve-path/LICENSE +23 -0
- package/test/node_modules/resolve-path/README.md +111 -0
- package/test/node_modules/resolve-path/index.js +88 -0
- package/test/node_modules/resolve-path/node_modules/depd/History.md +96 -0
- package/test/node_modules/resolve-path/node_modules/depd/LICENSE +22 -0
- package/test/node_modules/resolve-path/node_modules/depd/Readme.md +280 -0
- package/test/node_modules/resolve-path/node_modules/depd/index.js +522 -0
- package/test/node_modules/resolve-path/node_modules/depd/lib/browser/index.js +77 -0
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/callsite-tostring.js +103 -0
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/event-listener-count.js +22 -0
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/index.js +79 -0
- package/test/node_modules/resolve-path/node_modules/depd/package.json +41 -0
- package/test/node_modules/resolve-path/node_modules/http-errors/HISTORY.md +132 -0
- package/test/node_modules/resolve-path/node_modules/http-errors/LICENSE +23 -0
- package/test/node_modules/resolve-path/node_modules/http-errors/README.md +135 -0
- package/test/node_modules/resolve-path/node_modules/http-errors/index.js +260 -0
- package/test/node_modules/resolve-path/node_modules/http-errors/package.json +48 -0
- package/test/node_modules/resolve-path/node_modules/inherits/LICENSE +16 -0
- package/test/node_modules/resolve-path/node_modules/inherits/README.md +42 -0
- package/test/node_modules/resolve-path/node_modules/inherits/inherits.js +7 -0
- package/test/node_modules/resolve-path/node_modules/inherits/inherits_browser.js +23 -0
- package/test/node_modules/resolve-path/node_modules/inherits/package.json +29 -0
- package/test/node_modules/resolve-path/node_modules/setprototypeof/LICENSE +13 -0
- package/test/node_modules/resolve-path/node_modules/setprototypeof/README.md +26 -0
- package/test/node_modules/resolve-path/node_modules/setprototypeof/index.d.ts +2 -0
- package/test/node_modules/resolve-path/node_modules/setprototypeof/index.js +15 -0
- package/test/node_modules/resolve-path/node_modules/setprototypeof/package.json +25 -0
- package/test/node_modules/resolve-path/package.json +46 -0
- package/test/node_modules/safe-buffer/LICENSE +21 -0
- package/test/node_modules/safe-buffer/README.md +584 -0
- package/test/node_modules/safe-buffer/index.d.ts +187 -0
- package/test/node_modules/safe-buffer/index.js +65 -0
- package/test/node_modules/safe-buffer/package.json +51 -0
- package/test/node_modules/semver/CHANGELOG.md +39 -0
- package/test/node_modules/semver/LICENSE +15 -0
- package/test/node_modules/semver/README.md +412 -0
- package/test/node_modules/semver/bin/semver +160 -0
- package/test/node_modules/semver/package.json +28 -0
- package/test/node_modules/semver/range.bnf +16 -0
- package/test/node_modules/semver/semver.js +1483 -0
- package/test/node_modules/setprototypeof/LICENSE +13 -0
- package/test/node_modules/setprototypeof/README.md +31 -0
- package/test/node_modules/setprototypeof/index.d.ts +2 -0
- package/test/node_modules/setprototypeof/index.js +17 -0
- package/test/node_modules/setprototypeof/package.json +38 -0
- package/test/node_modules/setprototypeof/test/index.js +24 -0
- package/test/node_modules/sigmund/LICENSE +15 -0
- package/test/node_modules/sigmund/README.md +53 -0
- package/test/node_modules/sigmund/bench.js +283 -0
- package/test/node_modules/sigmund/package.json +30 -0
- package/test/node_modules/sigmund/sigmund.js +39 -0
- package/test/node_modules/sigmund/test/basic.js +24 -0
- package/test/node_modules/simple-update-notifier/LICENSE +21 -0
- package/test/node_modules/simple-update-notifier/README.md +82 -0
- package/test/node_modules/simple-update-notifier/build/index.d.ts +13 -0
- package/test/node_modules/simple-update-notifier/build/index.js +217 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/CHANGELOG.md +74 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/LICENSE +15 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/README.md +499 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/bin/semver.js +173 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/comparator.js +139 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/index.js +5 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/range.js +448 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/semver.js +290 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/clean.js +6 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/cmp.js +48 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/coerce.js +51 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-build.js +7 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-loose.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare.js +5 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/diff.js +25 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/eq.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gt.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gte.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/inc.js +15 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lt.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lte.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/major.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/minor.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/neq.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/parse.js +37 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/patch.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/prerelease.js +6 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rcompare.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rsort.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/satisfies.js +10 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/sort.js +3 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/valid.js +6 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/index.js +64 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/constants.js +17 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/debug.js +9 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/identifiers.js +23 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/re.js +179 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/package.json +34 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/range.bnf +16 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/gtr.js +4 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/intersects.js +7 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/ltr.js +4 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-version.js +57 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/outside.js +80 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/to-comparators.js +8 -0
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/valid.js +11 -0
- package/test/node_modules/simple-update-notifier/package.json +97 -0
- package/test/node_modules/simple-update-notifier/src/borderedText.ts +12 -0
- package/test/node_modules/simple-update-notifier/src/cache.spec.ts +17 -0
- package/test/node_modules/simple-update-notifier/src/cache.ts +44 -0
- package/test/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +35 -0
- package/test/node_modules/simple-update-notifier/src/getDistVersion.ts +29 -0
- package/test/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +82 -0
- package/test/node_modules/simple-update-notifier/src/hasNewVersion.ts +40 -0
- package/test/node_modules/simple-update-notifier/src/index.spec.ts +27 -0
- package/test/node_modules/simple-update-notifier/src/index.ts +34 -0
- package/test/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +12 -0
- package/test/node_modules/simple-update-notifier/src/types.ts +8 -0
- package/test/node_modules/statuses/HISTORY.md +65 -0
- package/test/node_modules/statuses/LICENSE +23 -0
- package/test/node_modules/statuses/README.md +127 -0
- package/test/node_modules/statuses/codes.json +66 -0
- package/test/node_modules/statuses/index.js +113 -0
- package/test/node_modules/statuses/package.json +48 -0
- package/test/node_modules/supports-color/browser.js +5 -0
- package/test/node_modules/supports-color/index.js +135 -0
- package/test/node_modules/supports-color/license +9 -0
- package/test/node_modules/supports-color/package.json +53 -0
- package/test/node_modules/supports-color/readme.md +76 -0
- package/test/node_modules/thenify/History.md +11 -0
- package/test/node_modules/thenify/LICENSE +22 -0
- package/test/node_modules/thenify/README.md +120 -0
- package/test/node_modules/thenify/index.js +77 -0
- package/test/node_modules/thenify/package.json +31 -0
- package/test/node_modules/thenify-all/History.md +11 -0
- package/test/node_modules/thenify-all/LICENSE +22 -0
- package/test/node_modules/thenify-all/README.md +66 -0
- package/test/node_modules/thenify-all/index.js +73 -0
- package/test/node_modules/thenify-all/package.json +34 -0
- package/test/node_modules/to-regex-range/LICENSE +21 -0
- package/test/node_modules/to-regex-range/README.md +305 -0
- package/test/node_modules/to-regex-range/index.js +288 -0
- package/test/node_modules/to-regex-range/package.json +88 -0
- package/test/node_modules/toidentifier/HISTORY.md +9 -0
- package/test/node_modules/toidentifier/LICENSE +21 -0
- package/test/node_modules/toidentifier/README.md +61 -0
- package/test/node_modules/toidentifier/index.js +32 -0
- package/test/node_modules/toidentifier/package.json +38 -0
- package/test/node_modules/touch/LICENSE +15 -0
- package/test/node_modules/touch/README.md +52 -0
- package/test/node_modules/touch/bin/nodetouch.js +112 -0
- package/test/node_modules/touch/index.js +224 -0
- package/test/node_modules/touch/node_modules/nopt/LICENSE +23 -0
- package/test/node_modules/touch/node_modules/nopt/README.md +208 -0
- package/test/node_modules/touch/node_modules/nopt/bin/nopt.js +44 -0
- package/test/node_modules/touch/node_modules/nopt/examples/my-program.js +30 -0
- package/test/node_modules/touch/node_modules/nopt/lib/nopt.js +552 -0
- package/test/node_modules/touch/node_modules/nopt/package.json +12 -0
- package/test/node_modules/touch/package.json +28 -0
- package/test/node_modules/tsscmp/.travis.yml +18 -0
- package/test/node_modules/tsscmp/LICENSE +21 -0
- package/test/node_modules/tsscmp/README.md +48 -0
- package/test/node_modules/tsscmp/appveyor.yml +29 -0
- package/test/node_modules/tsscmp/lib/index.js +38 -0
- package/test/node_modules/tsscmp/package.json +29 -0
- package/test/node_modules/tsscmp/test/benchmark/index.js +30 -0
- package/test/node_modules/tsscmp/test/unit/index.js +69 -0
- package/test/node_modules/type-is/HISTORY.md +259 -0
- package/test/node_modules/type-is/LICENSE +23 -0
- package/test/node_modules/type-is/README.md +170 -0
- package/test/node_modules/type-is/index.js +266 -0
- package/test/node_modules/type-is/package.json +45 -0
- package/test/node_modules/undefsafe/.github/workflows/release.yml +25 -0
- package/test/node_modules/undefsafe/.jscsrc +13 -0
- package/test/node_modules/undefsafe/.jshintrc +16 -0
- package/test/node_modules/undefsafe/.travis.yml +18 -0
- package/test/node_modules/undefsafe/LICENSE +22 -0
- package/test/node_modules/undefsafe/README.md +63 -0
- package/test/node_modules/undefsafe/example.js +14 -0
- package/test/node_modules/undefsafe/lib/undefsafe.js +125 -0
- package/test/node_modules/undefsafe/package.json +34 -0
- package/test/node_modules/vary/HISTORY.md +39 -0
- package/test/node_modules/vary/LICENSE +22 -0
- package/test/node_modules/vary/README.md +101 -0
- package/test/node_modules/vary/index.js +149 -0
- package/test/node_modules/vary/package.json +43 -0
- package/test/node_modules/wrappy/LICENSE +15 -0
- package/test/node_modules/wrappy/README.md +36 -0
- package/test/node_modules/wrappy/package.json +29 -0
- package/test/node_modules/wrappy/wrappy.js +33 -0
- package/test/node_modules/yallist/LICENSE +15 -0
- package/test/node_modules/yallist/README.md +204 -0
- package/test/node_modules/yallist/iterator.js +7 -0
- package/test/node_modules/yallist/package.json +29 -0
- package/test/node_modules/yallist/yallist.js +370 -0
- package/test/node_modules/ylru/History.md +42 -0
- package/test/node_modules/ylru/LICENSE +23 -0
- package/test/node_modules/ylru/README.md +99 -0
- package/test/node_modules/ylru/index.d.ts +18 -0
- package/test/node_modules/ylru/index.js +106 -0
- package/test/node_modules/ylru/package.json +52 -0
- package/test/package-lock.json +2212 -0
- package/test/package.json +17 -0
- package/test/public/api +1 -0
- package/test/public/cartella nuova/ewewew.html +12 -0
- package/test/public/cartella nuova/prova.ejs +12 -0
- package/test/public/index.ejs +12 -0
- package/test/public/index.html +12 -0
- package/test/public/proma_template.ejs +16 -0
- package/test/public/un altro file.html +12 -0
- package/test/public/un_file.html +12 -0
- package/test/test.js +63 -0
|
@@ -0,0 +1,1792 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/*
|
|
3
|
+
* Engines which do not support caching of their file contents
|
|
4
|
+
* should use the `read()` function defined in consolidate.js
|
|
5
|
+
* On top of this, when an engine compiles to a `Function`,
|
|
6
|
+
* these functions should either be cached within consolidate.js
|
|
7
|
+
* or the engine itself via `options.cache`. This will allow
|
|
8
|
+
* users and frameworks to pass `options.cache = true` for
|
|
9
|
+
* `NODE_ENV=production`, however edit the file(s) without
|
|
10
|
+
* re-loading the application in development.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Module dependencies.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var fs = require('fs');
|
|
18
|
+
var path = require('path');
|
|
19
|
+
var Promise = require('bluebird');
|
|
20
|
+
|
|
21
|
+
var join = path.join;
|
|
22
|
+
var resolve = path.resolve;
|
|
23
|
+
var extname = path.extname;
|
|
24
|
+
var dirname = path.dirname;
|
|
25
|
+
var isAbsolute = path.isAbsolute;
|
|
26
|
+
|
|
27
|
+
var readCache = {};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Require cache.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var cacheStore = {};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Require cache.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
var requires = {};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Clear the cache.
|
|
43
|
+
*
|
|
44
|
+
* @api public
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
exports.clearCache = function() {
|
|
48
|
+
readCache = {};
|
|
49
|
+
cacheStore = {};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Conditionally cache `compiled` template based
|
|
54
|
+
* on the `options` filename and `.cache` boolean.
|
|
55
|
+
*
|
|
56
|
+
* @param {Object} options
|
|
57
|
+
* @param {Function} compiled
|
|
58
|
+
* @return {Function}
|
|
59
|
+
* @api private
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
function cache(options, compiled) {
|
|
63
|
+
// cachable
|
|
64
|
+
if (compiled && options.filename && options.cache) {
|
|
65
|
+
delete readCache[options.filename];
|
|
66
|
+
cacheStore[options.filename] = compiled;
|
|
67
|
+
return compiled;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// check cache
|
|
71
|
+
if (options.filename && options.cache) {
|
|
72
|
+
return cacheStore[options.filename];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return compiled;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Read `path` with `options` with
|
|
80
|
+
* callback `(err, str)`. When `options.cache`
|
|
81
|
+
* is true the template string will be cached.
|
|
82
|
+
*
|
|
83
|
+
* @param {String} options
|
|
84
|
+
* @param {Function} cb
|
|
85
|
+
* @api private
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
function read(path, options, cb) {
|
|
89
|
+
var str = readCache[path];
|
|
90
|
+
var cached = options.cache && str && typeof str === 'string';
|
|
91
|
+
|
|
92
|
+
// cached (only if cached is a string and not a compiled template function)
|
|
93
|
+
if (cached) return cb(null, str);
|
|
94
|
+
|
|
95
|
+
// read
|
|
96
|
+
fs.readFile(path, 'utf8', function(err, str) {
|
|
97
|
+
if (err) return cb(err);
|
|
98
|
+
// remove extraneous utf8 BOM marker
|
|
99
|
+
str = str.replace(/^\uFEFF/, '');
|
|
100
|
+
if (options.cache) readCache[path] = str;
|
|
101
|
+
cb(null, str);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Read `path` with `options` with
|
|
107
|
+
* callback `(err, str)`. When `options.cache`
|
|
108
|
+
* is true the partial string will be cached.
|
|
109
|
+
*
|
|
110
|
+
* @param {String} options
|
|
111
|
+
* @param {Function} fn
|
|
112
|
+
* @api private
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
function readPartials(path, options, cb) {
|
|
116
|
+
if (!options.partials) return cb();
|
|
117
|
+
var keys = Object.keys(options.partials);
|
|
118
|
+
var partials = {};
|
|
119
|
+
|
|
120
|
+
function next(index) {
|
|
121
|
+
if (index === keys.length) return cb(null, partials);
|
|
122
|
+
var key = keys[index];
|
|
123
|
+
var partialPath = options.partials[key];
|
|
124
|
+
|
|
125
|
+
if (partialPath === undefined || partialPath === null || partialPath === false) {
|
|
126
|
+
return next(++index);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var file;
|
|
130
|
+
if (isAbsolute(partialPath)) {
|
|
131
|
+
if (extname(partialPath) !== '') {
|
|
132
|
+
file = partialPath;
|
|
133
|
+
} else {
|
|
134
|
+
file = join(partialPath + extname(path));
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
file = join(dirname(path), partialPath + extname(path));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
read(file, options, function(err, str) {
|
|
141
|
+
if (err) return cb(err);
|
|
142
|
+
partials[key] = str;
|
|
143
|
+
next(++index);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
next(0);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* promisify
|
|
152
|
+
*/
|
|
153
|
+
function promisify(cb, fn) {
|
|
154
|
+
return new Promise(function(resolve, reject) {
|
|
155
|
+
cb = cb || function(err, html) {
|
|
156
|
+
if (err) {
|
|
157
|
+
return reject(err);
|
|
158
|
+
}
|
|
159
|
+
resolve(html);
|
|
160
|
+
};
|
|
161
|
+
fn(cb);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* fromStringRenderer
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
function fromStringRenderer(name) {
|
|
170
|
+
return function(path, options, cb) {
|
|
171
|
+
options.filename = path;
|
|
172
|
+
|
|
173
|
+
return promisify(cb, function(cb) {
|
|
174
|
+
readPartials(path, options, function(err, partials) {
|
|
175
|
+
var extend = (requires.extend || (requires.extend = require('util')._extend));
|
|
176
|
+
var opts = extend({}, options);
|
|
177
|
+
opts.partials = partials;
|
|
178
|
+
if (err) return cb(err);
|
|
179
|
+
if (cache(opts)) {
|
|
180
|
+
exports[name].render('', opts, cb);
|
|
181
|
+
} else {
|
|
182
|
+
read(path, opts, function(err, str) {
|
|
183
|
+
if (err) return cb(err);
|
|
184
|
+
exports[name].render(str, opts, cb);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* velocity support.
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
exports.velocityjs = fromStringRenderer('velocityjs');
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* velocity string support.
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
exports.velocityjs.render = function(str, options, cb) {
|
|
203
|
+
return promisify(cb, function(cb) {
|
|
204
|
+
var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
|
|
205
|
+
try {
|
|
206
|
+
options.locals = options;
|
|
207
|
+
cb(null, engine.render(str, options).trimLeft());
|
|
208
|
+
} catch (err) {
|
|
209
|
+
cb(err);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Liquid support.
|
|
216
|
+
*/
|
|
217
|
+
|
|
218
|
+
exports.liquid = fromStringRenderer('liquid');
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Liquid string support.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Note that in order to get filters and custom tags we've had to push
|
|
226
|
+
* all user-defined locals down into @locals. However, just to make things
|
|
227
|
+
* backwards-compatible, any property of `options` that is left after
|
|
228
|
+
* processing and removing `locals`, `meta`, `filters`, `customTags` and
|
|
229
|
+
* `includeDir` will also become a local.
|
|
230
|
+
*/
|
|
231
|
+
|
|
232
|
+
function _renderTinyliquid(engine, str, options, cb) {
|
|
233
|
+
var context = engine.newContext();
|
|
234
|
+
var k;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Note that there's a bug in the library that doesn't allow us to pass
|
|
238
|
+
* the locals to newContext(), hence looping through the keys:
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
if (options.locals) {
|
|
242
|
+
for (k in options.locals) {
|
|
243
|
+
context.setLocals(k, options.locals[k]);
|
|
244
|
+
}
|
|
245
|
+
delete options.locals;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (options.meta) {
|
|
249
|
+
context.setLocals('page', options.meta);
|
|
250
|
+
delete options.meta;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Add any defined filters:
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
if (options.filters) {
|
|
258
|
+
for (k in options.filters) {
|
|
259
|
+
context.setFilter(k, options.filters[k]);
|
|
260
|
+
}
|
|
261
|
+
delete options.filters;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Set up a callback for the include directory:
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
var includeDir = options.includeDir || process.cwd();
|
|
269
|
+
|
|
270
|
+
context.onInclude(function(name, callback) {
|
|
271
|
+
var extname = path.extname(name) ? '' : '.liquid';
|
|
272
|
+
var filename = path.resolve(includeDir, name + extname);
|
|
273
|
+
|
|
274
|
+
fs.readFile(filename, {encoding: 'utf8'}, function(err, data) {
|
|
275
|
+
if (err) return callback(err);
|
|
276
|
+
callback(null, engine.parse(data));
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
delete options.includeDir;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* The custom tag functions need to have their results pushed back
|
|
283
|
+
* through the parser, so set up a shim before calling the provided
|
|
284
|
+
* callback:
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
var compileOptions = {
|
|
288
|
+
customTags: {}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
if (options.customTags) {
|
|
292
|
+
var tagFunctions = options.customTags;
|
|
293
|
+
|
|
294
|
+
for (k in options.customTags) {
|
|
295
|
+
/*Tell jshint there's no problem with having this function in the loop */
|
|
296
|
+
/*jshint -W083 */
|
|
297
|
+
compileOptions.customTags[k] = function(context, name, body) {
|
|
298
|
+
var tpl = tagFunctions[name](body.trim());
|
|
299
|
+
context.astStack.push(engine.parse(tpl));
|
|
300
|
+
};
|
|
301
|
+
/*jshint +W083 */
|
|
302
|
+
}
|
|
303
|
+
delete options.customTags;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Now anything left in `options` becomes a local:
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
for (k in options) {
|
|
311
|
+
context.setLocals(k, options[k]);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Finally, execute the template:
|
|
316
|
+
*/
|
|
317
|
+
|
|
318
|
+
var tmpl = cache(context) || cache(context, engine.compile(str, compileOptions));
|
|
319
|
+
tmpl(context, cb);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
exports.liquid.render = function(str, options, cb) {
|
|
323
|
+
return promisify(cb, function(cb) {
|
|
324
|
+
var engine = requires.liquid;
|
|
325
|
+
var Liquid;
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
// set up tinyliquid engine
|
|
329
|
+
engine = requires.liquid = require('tinyliquid');
|
|
330
|
+
|
|
331
|
+
// use tinyliquid engine
|
|
332
|
+
_renderTinyliquid(engine, str, options, cb);
|
|
333
|
+
|
|
334
|
+
return;
|
|
335
|
+
|
|
336
|
+
} catch (err) {
|
|
337
|
+
|
|
338
|
+
// set up liquid-node engine
|
|
339
|
+
try {
|
|
340
|
+
Liquid = requires.liquid = require('liquid-node');
|
|
341
|
+
engine = new Liquid.Engine();
|
|
342
|
+
} catch (err) {
|
|
343
|
+
throw err;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// use liquid-node engine
|
|
349
|
+
try {
|
|
350
|
+
var locals = options.locals || {};
|
|
351
|
+
|
|
352
|
+
if (options.meta) {
|
|
353
|
+
locals.pages = options.meta;
|
|
354
|
+
delete options.meta;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Add any defined filters:
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
if (options.filters) {
|
|
362
|
+
engine.registerFilters(options.filters);
|
|
363
|
+
delete options.filters;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Set up a callback for the include directory:
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
var includeDir = options.includeDir || process.cwd();
|
|
371
|
+
engine.fileSystem = new Liquid.LocalFileSystem(includeDir, 'liquid');
|
|
372
|
+
delete options.includeDir;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* The custom tag functions need to have their results pushed back
|
|
376
|
+
* through the parser, so set up a shim before calling the provided
|
|
377
|
+
* callback:
|
|
378
|
+
*/
|
|
379
|
+
|
|
380
|
+
if (options.customTags) {
|
|
381
|
+
var tagFunctions = options.customTags;
|
|
382
|
+
|
|
383
|
+
for (k in options.customTags) {
|
|
384
|
+
engine.registerTag(k, tagFunctions[k]);
|
|
385
|
+
}
|
|
386
|
+
delete options.customTags;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Now anything left in `options` becomes a local:
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
for (var k in options) {
|
|
394
|
+
locals[k] = options[k];
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Finally, execute the template:
|
|
399
|
+
*/
|
|
400
|
+
|
|
401
|
+
return engine
|
|
402
|
+
.parseAndRender(str, locals)
|
|
403
|
+
.nodeify(function(err, result) {
|
|
404
|
+
if (err) {
|
|
405
|
+
throw new Error(err);
|
|
406
|
+
} else {
|
|
407
|
+
return cb(null, result);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
} catch (err) {
|
|
412
|
+
cb(err);
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Jade support.
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
exports.jade = function(path, options, cb) {
|
|
422
|
+
return promisify(cb, function(cb) {
|
|
423
|
+
var engine = requires.jade;
|
|
424
|
+
if (!engine) {
|
|
425
|
+
try {
|
|
426
|
+
engine = requires.jade = require('jade');
|
|
427
|
+
} catch (err) {
|
|
428
|
+
try {
|
|
429
|
+
engine = requires.jade = require('then-jade');
|
|
430
|
+
} catch (otherError) {
|
|
431
|
+
throw err;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
try {
|
|
437
|
+
var tmpl = cache(options) || cache(options, engine.compileFile(path, options));
|
|
438
|
+
cb(null, tmpl(options));
|
|
439
|
+
} catch (err) {
|
|
440
|
+
cb(err);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Jade string support.
|
|
447
|
+
*/
|
|
448
|
+
|
|
449
|
+
exports.jade.render = function(str, options, cb) {
|
|
450
|
+
return promisify(cb, function(cb) {
|
|
451
|
+
var engine = requires.jade;
|
|
452
|
+
if (!engine) {
|
|
453
|
+
try {
|
|
454
|
+
engine = requires.jade = require('jade');
|
|
455
|
+
} catch (err) {
|
|
456
|
+
try {
|
|
457
|
+
engine = requires.jade = require('then-jade');
|
|
458
|
+
} catch (otherError) {
|
|
459
|
+
throw err;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
try {
|
|
465
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
466
|
+
cb(null, tmpl(options));
|
|
467
|
+
} catch (err) {
|
|
468
|
+
cb(err);
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Dust support.
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
exports.dust = fromStringRenderer('dust');
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Dust string support.
|
|
481
|
+
*/
|
|
482
|
+
|
|
483
|
+
exports.dust.render = function(str, options, cb) {
|
|
484
|
+
return promisify(cb, function(cb) {
|
|
485
|
+
var engine = requires.dust;
|
|
486
|
+
if (!engine) {
|
|
487
|
+
try {
|
|
488
|
+
engine = requires.dust = require('dust');
|
|
489
|
+
} catch (err) {
|
|
490
|
+
try {
|
|
491
|
+
engine = requires.dust = require('dustjs-helpers');
|
|
492
|
+
} catch (err) {
|
|
493
|
+
engine = requires.dust = require('dustjs-linkedin');
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
var ext = 'dust';
|
|
499
|
+
var views = '.';
|
|
500
|
+
|
|
501
|
+
if (options) {
|
|
502
|
+
if (options.ext) ext = options.ext;
|
|
503
|
+
if (options.views) views = options.views;
|
|
504
|
+
if (options.settings && options.settings.views) views = options.settings.views;
|
|
505
|
+
}
|
|
506
|
+
if (!options || (options && !options.cache)) engine.cache = {};
|
|
507
|
+
|
|
508
|
+
engine.onLoad = function(path, callback) {
|
|
509
|
+
if (extname(path) === '') path += '.' + ext;
|
|
510
|
+
if (path[0] !== '/') path = views + '/' + path;
|
|
511
|
+
read(path, options, callback);
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
try {
|
|
515
|
+
var templateName;
|
|
516
|
+
if (options.filename) {
|
|
517
|
+
templateName = options.filename.replace(new RegExp('^' + views + '/'), '').replace(new RegExp('\\.' + ext), '');
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var tmpl = cache(options) || cache(options, engine.compileFn(str, templateName));
|
|
521
|
+
tmpl(options, cb);
|
|
522
|
+
} catch (err) {
|
|
523
|
+
cb(err);
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Swig support.
|
|
530
|
+
*/
|
|
531
|
+
|
|
532
|
+
exports.swig = fromStringRenderer('swig');
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Swig string support.
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
exports.swig.render = function(str, options, cb) {
|
|
539
|
+
return promisify(cb, function(cb) {
|
|
540
|
+
var engine = requires.swig;
|
|
541
|
+
if (!engine) {
|
|
542
|
+
try {
|
|
543
|
+
engine = requires.swig = require('swig');
|
|
544
|
+
} catch (err) {
|
|
545
|
+
try {
|
|
546
|
+
engine = requires.swig = require('swig-templates');
|
|
547
|
+
} catch (otherError) {
|
|
548
|
+
throw err;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
try {
|
|
554
|
+
if (options.cache === true) options.cache = 'memory';
|
|
555
|
+
engine.setDefaults({ cache: options.cache });
|
|
556
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
557
|
+
cb(null, tmpl(options));
|
|
558
|
+
} catch (err) {
|
|
559
|
+
cb(err);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Razor support.
|
|
566
|
+
*/
|
|
567
|
+
|
|
568
|
+
exports.razor = function(path, options, cb) {
|
|
569
|
+
return promisify(cb, function(cb) {
|
|
570
|
+
var engine = requires.razor;
|
|
571
|
+
if (!engine) {
|
|
572
|
+
try {
|
|
573
|
+
engine = requires.razor = require('razor-tmpl');
|
|
574
|
+
|
|
575
|
+
} catch (err) {
|
|
576
|
+
|
|
577
|
+
throw err;
|
|
578
|
+
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
try {
|
|
582
|
+
|
|
583
|
+
var tmpl = cache(options) || cache(options, (locals) => {
|
|
584
|
+
console.log('Rendering razor file', path);
|
|
585
|
+
return engine.renderFileSync(path, locals);
|
|
586
|
+
});
|
|
587
|
+
cb(null, tmpl(options));
|
|
588
|
+
} catch (err) {
|
|
589
|
+
cb(err);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* razor string support.
|
|
596
|
+
*/
|
|
597
|
+
|
|
598
|
+
exports.razor.render = function(str, options, cb) {
|
|
599
|
+
return promisify(cb, function(cb) {
|
|
600
|
+
|
|
601
|
+
try {
|
|
602
|
+
var engine = requires.razor = require('razor-tmpl');
|
|
603
|
+
} catch (err) {
|
|
604
|
+
throw err;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
try {
|
|
608
|
+
var tf = engine.compile(str);
|
|
609
|
+
var tmpl = cache(options) || cache(options, tf);
|
|
610
|
+
cb(null, tmpl(options));
|
|
611
|
+
} catch (err) {
|
|
612
|
+
cb(err);
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Atpl support.
|
|
619
|
+
*/
|
|
620
|
+
|
|
621
|
+
exports.atpl = fromStringRenderer('atpl');
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Atpl string support.
|
|
625
|
+
*/
|
|
626
|
+
|
|
627
|
+
exports.atpl.render = function(str, options, cb) {
|
|
628
|
+
return promisify(cb, function(cb) {
|
|
629
|
+
var engine = requires.atpl || (requires.atpl = require('atpl'));
|
|
630
|
+
try {
|
|
631
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
632
|
+
cb(null, tmpl(options));
|
|
633
|
+
} catch (err) {
|
|
634
|
+
cb(err);
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Liquor support,
|
|
641
|
+
*/
|
|
642
|
+
|
|
643
|
+
exports.liquor = fromStringRenderer('liquor');
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Liquor string support.
|
|
647
|
+
*/
|
|
648
|
+
|
|
649
|
+
exports.liquor.render = function(str, options, cb) {
|
|
650
|
+
return promisify(cb, function(cb) {
|
|
651
|
+
var engine = requires.liquor || (requires.liquor = require('liquor'));
|
|
652
|
+
try {
|
|
653
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
654
|
+
cb(null, tmpl(options));
|
|
655
|
+
} catch (err) {
|
|
656
|
+
cb(err);
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Twig support.
|
|
663
|
+
*/
|
|
664
|
+
|
|
665
|
+
exports.twig = fromStringRenderer('twig');
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Twig string support.
|
|
669
|
+
*/
|
|
670
|
+
|
|
671
|
+
exports.twig.render = function(str, options, cb) {
|
|
672
|
+
return promisify(cb, function(cb) {
|
|
673
|
+
var engine = requires.twig || (requires.twig = require('twig').twig);
|
|
674
|
+
var templateData = {
|
|
675
|
+
data: str,
|
|
676
|
+
allowInlineIncludes: options.allowInlineIncludes,
|
|
677
|
+
namespaces: options.namespaces,
|
|
678
|
+
path: options.path
|
|
679
|
+
};
|
|
680
|
+
try {
|
|
681
|
+
var tmpl = cache(templateData) || cache(templateData, engine(templateData));
|
|
682
|
+
cb(null, tmpl.render(options));
|
|
683
|
+
} catch (err) {
|
|
684
|
+
cb(err);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* EJS support.
|
|
691
|
+
*/
|
|
692
|
+
|
|
693
|
+
exports.ejs = fromStringRenderer('ejs');
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* EJS string support.
|
|
697
|
+
*/
|
|
698
|
+
|
|
699
|
+
exports.ejs.render = function(str, options, cb) {
|
|
700
|
+
return promisify(cb, function(cb) {
|
|
701
|
+
var engine = requires.ejs || (requires.ejs = require('ejs'));
|
|
702
|
+
try {
|
|
703
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
704
|
+
cb(null, tmpl(options));
|
|
705
|
+
} catch (err) {
|
|
706
|
+
cb(err);
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Eco support.
|
|
713
|
+
*/
|
|
714
|
+
|
|
715
|
+
exports.eco = fromStringRenderer('eco');
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Eco string support.
|
|
719
|
+
*/
|
|
720
|
+
|
|
721
|
+
exports.eco.render = function(str, options, cb) {
|
|
722
|
+
return promisify(cb, function(cb) {
|
|
723
|
+
var engine = requires.eco || (requires.eco = require('eco'));
|
|
724
|
+
try {
|
|
725
|
+
cb(null, engine.render(str, options));
|
|
726
|
+
} catch (err) {
|
|
727
|
+
cb(err);
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Jazz support.
|
|
734
|
+
*/
|
|
735
|
+
|
|
736
|
+
exports.jazz = fromStringRenderer('jazz');
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Jazz string support.
|
|
740
|
+
*/
|
|
741
|
+
|
|
742
|
+
exports.jazz.render = function(str, options, cb) {
|
|
743
|
+
return promisify(cb, function(cb) {
|
|
744
|
+
var engine = requires.jazz || (requires.jazz = require('jazz'));
|
|
745
|
+
try {
|
|
746
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
747
|
+
tmpl.eval(options, function(str) {
|
|
748
|
+
cb(null, str);
|
|
749
|
+
});
|
|
750
|
+
} catch (err) {
|
|
751
|
+
cb(err);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* JQTPL support.
|
|
758
|
+
*/
|
|
759
|
+
|
|
760
|
+
exports.jqtpl = fromStringRenderer('jqtpl');
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* JQTPL string support.
|
|
764
|
+
*/
|
|
765
|
+
|
|
766
|
+
exports.jqtpl.render = function(str, options, cb) {
|
|
767
|
+
return promisify(cb, function(cb) {
|
|
768
|
+
var engine = requires.jqtpl || (requires.jqtpl = require('jqtpl'));
|
|
769
|
+
try {
|
|
770
|
+
engine.template(str, str);
|
|
771
|
+
cb(null, engine.tmpl(str, options));
|
|
772
|
+
} catch (err) {
|
|
773
|
+
cb(err);
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Haml support.
|
|
780
|
+
*/
|
|
781
|
+
|
|
782
|
+
exports.haml = fromStringRenderer('haml');
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Haml string support.
|
|
786
|
+
*/
|
|
787
|
+
|
|
788
|
+
exports.haml.render = function(str, options, cb) {
|
|
789
|
+
return promisify(cb, function(cb) {
|
|
790
|
+
var engine = requires.haml || (requires.haml = require('hamljs'));
|
|
791
|
+
try {
|
|
792
|
+
options.locals = options;
|
|
793
|
+
cb(null, engine.render(str, options).trimLeft());
|
|
794
|
+
} catch (err) {
|
|
795
|
+
cb(err);
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Hamlet support.
|
|
802
|
+
*/
|
|
803
|
+
|
|
804
|
+
exports.hamlet = fromStringRenderer('hamlet');
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Hamlet string support.
|
|
808
|
+
*/
|
|
809
|
+
|
|
810
|
+
exports.hamlet.render = function(str, options, cb) {
|
|
811
|
+
return promisify(cb, function(cb) {
|
|
812
|
+
var engine = requires.hamlet || (requires.hamlet = require('hamlet'));
|
|
813
|
+
try {
|
|
814
|
+
options.locals = options;
|
|
815
|
+
cb(null, engine.render(str, options).trimLeft());
|
|
816
|
+
} catch (err) {
|
|
817
|
+
cb(err);
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Whiskers support.
|
|
824
|
+
*/
|
|
825
|
+
|
|
826
|
+
exports.whiskers = function(path, options, cb) {
|
|
827
|
+
return promisify(cb, function(cb) {
|
|
828
|
+
var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
|
|
829
|
+
engine.__express(path, options, cb);
|
|
830
|
+
});
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Whiskers string support.
|
|
835
|
+
*/
|
|
836
|
+
|
|
837
|
+
exports.whiskers.render = function(str, options, cb) {
|
|
838
|
+
return promisify(cb, function(cb) {
|
|
839
|
+
var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
|
|
840
|
+
try {
|
|
841
|
+
cb(null, engine.render(str, options));
|
|
842
|
+
} catch (err) {
|
|
843
|
+
cb(err);
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Coffee-HAML support.
|
|
850
|
+
*/
|
|
851
|
+
|
|
852
|
+
exports['haml-coffee'] = fromStringRenderer('haml-coffee');
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Coffee-HAML string support.
|
|
856
|
+
*/
|
|
857
|
+
|
|
858
|
+
exports['haml-coffee'].render = function(str, options, cb) {
|
|
859
|
+
return promisify(cb, function(cb) {
|
|
860
|
+
var engine = requires['haml-coffee'] || (requires['haml-coffee'] = require('haml-coffee'));
|
|
861
|
+
try {
|
|
862
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
863
|
+
cb(null, tmpl(options));
|
|
864
|
+
} catch (err) {
|
|
865
|
+
cb(err);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Hogan support.
|
|
872
|
+
*/
|
|
873
|
+
|
|
874
|
+
exports.hogan = fromStringRenderer('hogan');
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Hogan string support.
|
|
878
|
+
*/
|
|
879
|
+
|
|
880
|
+
exports.hogan.render = function(str, options, cb) {
|
|
881
|
+
return promisify(cb, function(cb) {
|
|
882
|
+
var engine = requires.hogan || (requires.hogan = require('hogan.js'));
|
|
883
|
+
try {
|
|
884
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
885
|
+
cb(null, tmpl.render(options, options.partials));
|
|
886
|
+
} catch (err) {
|
|
887
|
+
cb(err);
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* templayed.js support.
|
|
894
|
+
*/
|
|
895
|
+
|
|
896
|
+
exports.templayed = fromStringRenderer('templayed');
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* templayed.js string support.
|
|
900
|
+
*/
|
|
901
|
+
|
|
902
|
+
exports.templayed.render = function(str, options, cb) {
|
|
903
|
+
return promisify(cb, function(cb) {
|
|
904
|
+
var engine = requires.templayed || (requires.templayed = require('templayed'));
|
|
905
|
+
try {
|
|
906
|
+
var tmpl = cache(options) || cache(options, engine(str));
|
|
907
|
+
cb(null, tmpl(options));
|
|
908
|
+
} catch (err) {
|
|
909
|
+
cb(err);
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Handlebars support.
|
|
916
|
+
*/
|
|
917
|
+
|
|
918
|
+
exports.handlebars = fromStringRenderer('handlebars');
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Handlebars string support.
|
|
922
|
+
*/
|
|
923
|
+
|
|
924
|
+
exports.handlebars.render = function(str, options, cb) {
|
|
925
|
+
return promisify(cb, function(cb) {
|
|
926
|
+
var engine = requires.handlebars || (requires.handlebars = require('handlebars'));
|
|
927
|
+
try {
|
|
928
|
+
for (var partial in options.partials) {
|
|
929
|
+
engine.registerPartial(partial, options.partials[partial]);
|
|
930
|
+
}
|
|
931
|
+
for (var helper in options.helpers) {
|
|
932
|
+
engine.registerHelper(helper, options.helpers[helper]);
|
|
933
|
+
}
|
|
934
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
935
|
+
cb(null, tmpl(options));
|
|
936
|
+
} catch (err) {
|
|
937
|
+
cb(err);
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Underscore support.
|
|
944
|
+
*/
|
|
945
|
+
|
|
946
|
+
exports.underscore = fromStringRenderer('underscore');
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Underscore string support.
|
|
950
|
+
*/
|
|
951
|
+
|
|
952
|
+
exports.underscore.render = function(str, options, cb) {
|
|
953
|
+
return promisify(cb, function(cb) {
|
|
954
|
+
var engine = requires.underscore || (requires.underscore = require('underscore'));
|
|
955
|
+
try {
|
|
956
|
+
const partials = {};
|
|
957
|
+
for (var partial in options.partials) {
|
|
958
|
+
partials[partial] = engine.template(options.partials[partial]);
|
|
959
|
+
}
|
|
960
|
+
options.partials = partials;
|
|
961
|
+
var tmpl = cache(options) || cache(options, engine.template(str, null, options));
|
|
962
|
+
cb(null, tmpl(options).replace(/\n$/, ''));
|
|
963
|
+
} catch (err) {
|
|
964
|
+
cb(err);
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Lodash support.
|
|
971
|
+
*/
|
|
972
|
+
|
|
973
|
+
exports.lodash = fromStringRenderer('lodash');
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Lodash string support.
|
|
977
|
+
*/
|
|
978
|
+
|
|
979
|
+
exports.lodash.render = function(str, options, cb) {
|
|
980
|
+
return promisify(cb, function(cb) {
|
|
981
|
+
var engine = requires.lodash || (requires.lodash = require('lodash'));
|
|
982
|
+
try {
|
|
983
|
+
var tmpl = cache(options) || cache(options, engine.template(str, options));
|
|
984
|
+
cb(null, tmpl(options).replace(/\n$/, ''));
|
|
985
|
+
} catch (err) {
|
|
986
|
+
cb(err);
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Pug support. (formerly Jade)
|
|
993
|
+
*/
|
|
994
|
+
|
|
995
|
+
exports.pug = function(path, options, cb) {
|
|
996
|
+
return promisify(cb, function(cb) {
|
|
997
|
+
var engine = requires.pug;
|
|
998
|
+
if (!engine) {
|
|
999
|
+
try {
|
|
1000
|
+
engine = requires.pug = require('pug');
|
|
1001
|
+
} catch (err) {
|
|
1002
|
+
try {
|
|
1003
|
+
engine = requires.pug = require('then-pug');
|
|
1004
|
+
} catch (otherError) {
|
|
1005
|
+
throw err;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
try {
|
|
1011
|
+
var tmpl = cache(options) || cache(options, engine.compileFile(path, options));
|
|
1012
|
+
cb(null, tmpl(options));
|
|
1013
|
+
} catch (err) {
|
|
1014
|
+
cb(err);
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Pug string support.
|
|
1021
|
+
*/
|
|
1022
|
+
|
|
1023
|
+
exports.pug.render = function(str, options, cb) {
|
|
1024
|
+
return promisify(cb, function(cb) {
|
|
1025
|
+
var engine = requires.pug;
|
|
1026
|
+
if (!engine) {
|
|
1027
|
+
try {
|
|
1028
|
+
engine = requires.pug = require('pug');
|
|
1029
|
+
} catch (err) {
|
|
1030
|
+
try {
|
|
1031
|
+
engine = requires.pug = require('then-pug');
|
|
1032
|
+
} catch (otherError) {
|
|
1033
|
+
throw err;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
try {
|
|
1039
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
1040
|
+
cb(null, tmpl(options));
|
|
1041
|
+
} catch (err) {
|
|
1042
|
+
cb(err);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* QEJS support.
|
|
1049
|
+
*/
|
|
1050
|
+
|
|
1051
|
+
exports.qejs = fromStringRenderer('qejs');
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* QEJS string support.
|
|
1055
|
+
*/
|
|
1056
|
+
|
|
1057
|
+
exports.qejs.render = function(str, options, cb) {
|
|
1058
|
+
return promisify(cb, function(cb) {
|
|
1059
|
+
try {
|
|
1060
|
+
var engine = requires.qejs || (requires.qejs = require('qejs'));
|
|
1061
|
+
engine.render(str, options).then(function(result) {
|
|
1062
|
+
cb(null, result);
|
|
1063
|
+
}, function(err) {
|
|
1064
|
+
cb(err);
|
|
1065
|
+
}).done();
|
|
1066
|
+
} catch (err) {
|
|
1067
|
+
cb(err);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Walrus support.
|
|
1074
|
+
*/
|
|
1075
|
+
|
|
1076
|
+
exports.walrus = fromStringRenderer('walrus');
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Walrus string support.
|
|
1080
|
+
*/
|
|
1081
|
+
|
|
1082
|
+
exports.walrus.render = function(str, options, cb) {
|
|
1083
|
+
return promisify(cb, function(cb) {
|
|
1084
|
+
var engine = requires.walrus || (requires.walrus = require('walrus'));
|
|
1085
|
+
try {
|
|
1086
|
+
var tmpl = cache(options) || cache(options, engine.parse(str));
|
|
1087
|
+
cb(null, tmpl.compile(options));
|
|
1088
|
+
} catch (err) {
|
|
1089
|
+
cb(err);
|
|
1090
|
+
}
|
|
1091
|
+
});
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Mustache support.
|
|
1096
|
+
*/
|
|
1097
|
+
|
|
1098
|
+
exports.mustache = fromStringRenderer('mustache');
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Mustache string support.
|
|
1102
|
+
*/
|
|
1103
|
+
|
|
1104
|
+
exports.mustache.render = function(str, options, cb) {
|
|
1105
|
+
return promisify(cb, function(cb) {
|
|
1106
|
+
var engine = requires.mustache || (requires.mustache = require('mustache'));
|
|
1107
|
+
try {
|
|
1108
|
+
cb(null, engine.render(str, options, options.partials));
|
|
1109
|
+
} catch (err) {
|
|
1110
|
+
cb(err);
|
|
1111
|
+
}
|
|
1112
|
+
});
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Just support.
|
|
1117
|
+
*/
|
|
1118
|
+
|
|
1119
|
+
exports.just = function(path, options, cb) {
|
|
1120
|
+
return promisify(cb, function(cb) {
|
|
1121
|
+
var engine = requires.just;
|
|
1122
|
+
if (!engine) {
|
|
1123
|
+
var JUST = require('just');
|
|
1124
|
+
engine = requires.just = new JUST();
|
|
1125
|
+
}
|
|
1126
|
+
engine.configure({ useCache: options.cache });
|
|
1127
|
+
engine.render(path, options, cb);
|
|
1128
|
+
});
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Just string support.
|
|
1133
|
+
*/
|
|
1134
|
+
|
|
1135
|
+
exports.just.render = function(str, options, cb) {
|
|
1136
|
+
return promisify(cb, function(cb) {
|
|
1137
|
+
var JUST = require('just');
|
|
1138
|
+
var engine = new JUST({ root: { page: str }});
|
|
1139
|
+
engine.render('page', options, cb);
|
|
1140
|
+
});
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* ECT support.
|
|
1145
|
+
*/
|
|
1146
|
+
|
|
1147
|
+
exports.ect = function(path, options, cb) {
|
|
1148
|
+
return promisify(cb, function(cb) {
|
|
1149
|
+
var engine = requires.ect;
|
|
1150
|
+
if (!engine) {
|
|
1151
|
+
var ECT = require('ect');
|
|
1152
|
+
engine = requires.ect = new ECT(options);
|
|
1153
|
+
}
|
|
1154
|
+
engine.configure({ cache: options.cache });
|
|
1155
|
+
engine.render(path, options, cb);
|
|
1156
|
+
});
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* ECT string support.
|
|
1161
|
+
*/
|
|
1162
|
+
|
|
1163
|
+
exports.ect.render = function(str, options, cb) {
|
|
1164
|
+
return promisify(cb, function(cb) {
|
|
1165
|
+
var ECT = require('ect');
|
|
1166
|
+
var engine = new ECT({ root: { page: str }});
|
|
1167
|
+
engine.render('page', options, cb);
|
|
1168
|
+
});
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* mote support.
|
|
1173
|
+
*/
|
|
1174
|
+
|
|
1175
|
+
exports.mote = fromStringRenderer('mote');
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* mote string support.
|
|
1179
|
+
*/
|
|
1180
|
+
|
|
1181
|
+
exports.mote.render = function(str, options, cb) {
|
|
1182
|
+
return promisify(cb, function(cb) {
|
|
1183
|
+
var engine = requires.mote || (requires.mote = require('mote'));
|
|
1184
|
+
try {
|
|
1185
|
+
var tmpl = cache(options) || cache(options, engine.compile(str));
|
|
1186
|
+
cb(null, tmpl(options));
|
|
1187
|
+
} catch (err) {
|
|
1188
|
+
cb(err);
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Toffee support.
|
|
1195
|
+
*/
|
|
1196
|
+
|
|
1197
|
+
exports.toffee = function(path, options, cb) {
|
|
1198
|
+
return promisify(cb, function(cb) {
|
|
1199
|
+
var toffee = requires.toffee || (requires.toffee = require('toffee'));
|
|
1200
|
+
toffee.__consolidate_engine_render(path, options, cb);
|
|
1201
|
+
});
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Toffee string support.
|
|
1206
|
+
*/
|
|
1207
|
+
|
|
1208
|
+
exports.toffee.render = function(str, options, cb) {
|
|
1209
|
+
return promisify(cb, function(cb) {
|
|
1210
|
+
var engine = requires.toffee || (requires.toffee = require('toffee'));
|
|
1211
|
+
try {
|
|
1212
|
+
engine.str_render(str, options, cb);
|
|
1213
|
+
} catch (err) {
|
|
1214
|
+
cb(err);
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* doT support.
|
|
1221
|
+
*/
|
|
1222
|
+
|
|
1223
|
+
exports.dot = fromStringRenderer('dot');
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* doT string support.
|
|
1227
|
+
*/
|
|
1228
|
+
|
|
1229
|
+
exports.dot.render = function(str, options, cb) {
|
|
1230
|
+
return promisify(cb, function(cb) {
|
|
1231
|
+
var engine = requires.dot || (requires.dot = require('dot'));
|
|
1232
|
+
var extend = (requires.extend || (requires.extend = require('util')._extend));
|
|
1233
|
+
try {
|
|
1234
|
+
var settings = {};
|
|
1235
|
+
settings = extend(settings, engine.templateSettings);
|
|
1236
|
+
settings = extend(settings, options ? options.dot : {});
|
|
1237
|
+
var tmpl = cache(options) || cache(options, engine.template(str, settings, options));
|
|
1238
|
+
cb(null, tmpl(options));
|
|
1239
|
+
} catch (err) {
|
|
1240
|
+
cb(err);
|
|
1241
|
+
}
|
|
1242
|
+
});
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* bracket support.
|
|
1247
|
+
*/
|
|
1248
|
+
|
|
1249
|
+
exports.bracket = fromStringRenderer('bracket');
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* bracket string support.
|
|
1253
|
+
*/
|
|
1254
|
+
|
|
1255
|
+
exports.bracket.render = function(str, options, cb) {
|
|
1256
|
+
return promisify(cb, function(cb) {
|
|
1257
|
+
var engine = requires.bracket || (requires.bracket = require('bracket-template'));
|
|
1258
|
+
try {
|
|
1259
|
+
var tmpl = cache(options) || cache(options, engine.default.compile(str, options));
|
|
1260
|
+
cb(null, tmpl(options));
|
|
1261
|
+
} catch (err) {
|
|
1262
|
+
cb(err);
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Ractive support.
|
|
1269
|
+
*/
|
|
1270
|
+
|
|
1271
|
+
exports.ractive = fromStringRenderer('ractive');
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* Ractive string support.
|
|
1275
|
+
*/
|
|
1276
|
+
|
|
1277
|
+
exports.ractive.render = function(str, options, cb) {
|
|
1278
|
+
return promisify(cb, function(cb) {
|
|
1279
|
+
var Engine = requires.ractive || (requires.ractive = require('ractive'));
|
|
1280
|
+
|
|
1281
|
+
var template = cache(options) || cache(options, Engine.parse(str));
|
|
1282
|
+
options.template = template;
|
|
1283
|
+
|
|
1284
|
+
if (options.data === null || options.data === undefined) {
|
|
1285
|
+
var extend = (requires.extend || (requires.extend = require('util')._extend));
|
|
1286
|
+
|
|
1287
|
+
// Shallow clone the options object
|
|
1288
|
+
options.data = extend({}, options);
|
|
1289
|
+
|
|
1290
|
+
// Remove consolidate-specific properties from the clone
|
|
1291
|
+
var i;
|
|
1292
|
+
var length;
|
|
1293
|
+
var properties = ['template', 'filename', 'cache', 'partials'];
|
|
1294
|
+
for (i = 0, length = properties.length; i < length; i++) {
|
|
1295
|
+
var property = properties[i];
|
|
1296
|
+
delete options.data[property];
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
try {
|
|
1301
|
+
cb(null, new Engine(options).toHTML());
|
|
1302
|
+
} catch (err) {
|
|
1303
|
+
cb(err);
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Nunjucks support.
|
|
1310
|
+
*/
|
|
1311
|
+
|
|
1312
|
+
exports.nunjucks = fromStringRenderer('nunjucks');
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* Nunjucks string support.
|
|
1316
|
+
*/
|
|
1317
|
+
|
|
1318
|
+
exports.nunjucks.render = function(str, options, cb) {
|
|
1319
|
+
return promisify(cb, function(cb) {
|
|
1320
|
+
|
|
1321
|
+
try {
|
|
1322
|
+
|
|
1323
|
+
var engine = options.nunjucksEnv || requires.nunjucks || (requires.nunjucks = require('nunjucks'));
|
|
1324
|
+
|
|
1325
|
+
var env = engine;
|
|
1326
|
+
|
|
1327
|
+
// deprecated fallback support for express
|
|
1328
|
+
// <https://github.com/tj/consolidate.js/pull/152>
|
|
1329
|
+
// <https://github.com/tj/consolidate.js/pull/224>
|
|
1330
|
+
if (options.settings && options.settings.views) {
|
|
1331
|
+
env = engine.configure(options.settings.views);
|
|
1332
|
+
} else if (options.nunjucks && options.nunjucks.configure) {
|
|
1333
|
+
env = engine.configure.apply(engine, options.nunjucks.configure);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
//
|
|
1337
|
+
// because `renderString` does not initiate loaders
|
|
1338
|
+
// we must manually create a loader for it based off
|
|
1339
|
+
// either `options.settings.views` or `options.nunjucks` or `options.nunjucks.root`
|
|
1340
|
+
//
|
|
1341
|
+
// <https://github.com/mozilla/nunjucks/issues/730>
|
|
1342
|
+
// <https://github.com/crocodilejs/node-email-templates/issues/182>
|
|
1343
|
+
//
|
|
1344
|
+
|
|
1345
|
+
// so instead we simply check if we passed a custom loader
|
|
1346
|
+
// otherwise we create a simple file based loader
|
|
1347
|
+
if (options.loader) {
|
|
1348
|
+
env = new engine.Environment(options.loader);
|
|
1349
|
+
} else if (options.settings && options.settings.views) {
|
|
1350
|
+
env = new engine.Environment(
|
|
1351
|
+
new engine.FileSystemLoader(options.settings.views)
|
|
1352
|
+
);
|
|
1353
|
+
} else if (options.nunjucks && options.nunjucks.loader) {
|
|
1354
|
+
if (typeof options.nunjucks.loader === 'string') {
|
|
1355
|
+
env = new engine.Environment(new engine.FileSystemLoader(options.nunjucks.loader));
|
|
1356
|
+
} else {
|
|
1357
|
+
env = new engine.Environment(
|
|
1358
|
+
new engine.FileSystemLoader(
|
|
1359
|
+
options.nunjucks.loader[0],
|
|
1360
|
+
options.nunjucks.loader[1]
|
|
1361
|
+
)
|
|
1362
|
+
);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
env.renderString(str, options, cb);
|
|
1367
|
+
} catch (err) {
|
|
1368
|
+
throw cb(err);
|
|
1369
|
+
}
|
|
1370
|
+
});
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* HTMLing support.
|
|
1375
|
+
*/
|
|
1376
|
+
|
|
1377
|
+
exports.htmling = fromStringRenderer('htmling');
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* HTMLing string support.
|
|
1381
|
+
*/
|
|
1382
|
+
|
|
1383
|
+
exports.htmling.render = function(str, options, cb) {
|
|
1384
|
+
return promisify(cb, function(cb) {
|
|
1385
|
+
var engine = requires.htmling || (requires.htmling = require('htmling'));
|
|
1386
|
+
try {
|
|
1387
|
+
var tmpl = cache(options) || cache(options, engine.string(str));
|
|
1388
|
+
cb(null, tmpl.render(options));
|
|
1389
|
+
} catch (err) {
|
|
1390
|
+
cb(err);
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
};
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Rendering function
|
|
1397
|
+
*/
|
|
1398
|
+
function requireReact(module, filename) {
|
|
1399
|
+
var babel = requires.babel || (requires.babel = require('babel-core'));
|
|
1400
|
+
|
|
1401
|
+
var compiled = babel.transformFileSync(filename, { presets: [ 'react' ] }).code;
|
|
1402
|
+
|
|
1403
|
+
return module._compile(compiled, filename);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
exports.requireReact = requireReact;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Converting a string into a node module.
|
|
1410
|
+
*/
|
|
1411
|
+
function requireReactString(src, filename) {
|
|
1412
|
+
var babel = requires.babel || (requires.babel = require('babel-core'));
|
|
1413
|
+
|
|
1414
|
+
if (!filename) filename = '';
|
|
1415
|
+
var m = new module.constructor();
|
|
1416
|
+
filename = filename || '';
|
|
1417
|
+
|
|
1418
|
+
// Compile Using React
|
|
1419
|
+
var compiled = babel.transform(src, { presets: [ 'react' ] }).code;
|
|
1420
|
+
|
|
1421
|
+
// Compile as a module
|
|
1422
|
+
m.paths = module.paths;
|
|
1423
|
+
m._compile(compiled, filename);
|
|
1424
|
+
|
|
1425
|
+
return m.exports;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
/**
|
|
1429
|
+
* A naive helper to replace {{tags}} with options.tags content
|
|
1430
|
+
*/
|
|
1431
|
+
function reactBaseTmpl(data, options) {
|
|
1432
|
+
|
|
1433
|
+
var exp;
|
|
1434
|
+
var regex;
|
|
1435
|
+
|
|
1436
|
+
// Iterates through the keys in file object
|
|
1437
|
+
// and interpolate / replace {{key}} with it's value
|
|
1438
|
+
for (var k in options) {
|
|
1439
|
+
if (options.hasOwnProperty(k)) {
|
|
1440
|
+
exp = '{{' + k + '}}';
|
|
1441
|
+
regex = new RegExp(exp, 'g');
|
|
1442
|
+
if (data.match(regex)) {
|
|
1443
|
+
data = data.replace(regex, options[k]);
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
return data;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Plates Support.
|
|
1453
|
+
*/
|
|
1454
|
+
|
|
1455
|
+
exports.plates = fromStringRenderer('plates');
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* Plates string support.
|
|
1459
|
+
*/
|
|
1460
|
+
|
|
1461
|
+
exports.plates.render = function(str, options, cb) {
|
|
1462
|
+
return promisify(cb, function(cb) {
|
|
1463
|
+
var engine = requires.plates || (requires.plates = require('plates'));
|
|
1464
|
+
var map = options.map || undefined;
|
|
1465
|
+
try {
|
|
1466
|
+
var tmpl = engine.bind(str, options, map);
|
|
1467
|
+
cb(null, tmpl);
|
|
1468
|
+
} catch (err) {
|
|
1469
|
+
cb(err);
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* The main render parser for React bsaed templates
|
|
1476
|
+
*/
|
|
1477
|
+
function reactRenderer(type) {
|
|
1478
|
+
|
|
1479
|
+
if (require.extensions) {
|
|
1480
|
+
|
|
1481
|
+
// Ensure JSX is transformed on require
|
|
1482
|
+
if (!require.extensions['.jsx']) {
|
|
1483
|
+
require.extensions['.jsx'] = requireReact;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
// Supporting .react extension as well as test cases
|
|
1487
|
+
// Using .react extension is not recommended.
|
|
1488
|
+
if (!require.extensions['.react']) {
|
|
1489
|
+
require.extensions['.react'] = requireReact;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
// Return rendering fx
|
|
1495
|
+
return function(str, options, cb) {
|
|
1496
|
+
return promisify(cb, function(cb) {
|
|
1497
|
+
// React Import
|
|
1498
|
+
var ReactDOM = requires.ReactDOM || (requires.ReactDOM = require('react-dom/server'));
|
|
1499
|
+
var react = requires.react || (requires.react = require('react'));
|
|
1500
|
+
|
|
1501
|
+
// Assign HTML Base
|
|
1502
|
+
var base = options.base;
|
|
1503
|
+
delete options.base;
|
|
1504
|
+
|
|
1505
|
+
var enableCache = options.cache;
|
|
1506
|
+
delete options.cache;
|
|
1507
|
+
|
|
1508
|
+
var isNonStatic = options.isNonStatic;
|
|
1509
|
+
delete options.isNonStatic;
|
|
1510
|
+
|
|
1511
|
+
// Start Conversion
|
|
1512
|
+
try {
|
|
1513
|
+
|
|
1514
|
+
var Code;
|
|
1515
|
+
var Factory;
|
|
1516
|
+
|
|
1517
|
+
var baseStr;
|
|
1518
|
+
var content;
|
|
1519
|
+
var parsed;
|
|
1520
|
+
|
|
1521
|
+
if (!cache(options)) {
|
|
1522
|
+
// Parsing
|
|
1523
|
+
if (type === 'path') {
|
|
1524
|
+
var path = resolve(str);
|
|
1525
|
+
delete require.cache[path];
|
|
1526
|
+
Code = require(path);
|
|
1527
|
+
} else {
|
|
1528
|
+
Code = requireReactString(str);
|
|
1529
|
+
}
|
|
1530
|
+
Factory = cache(options, react.createFactory(Code));
|
|
1531
|
+
|
|
1532
|
+
} else {
|
|
1533
|
+
Factory = cache(options);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
parsed = new Factory(options);
|
|
1537
|
+
content = (isNonStatic) ? ReactDOM.renderToString(parsed) : ReactDOM.renderToStaticMarkup(parsed);
|
|
1538
|
+
|
|
1539
|
+
if (base) {
|
|
1540
|
+
baseStr = readCache[str] || fs.readFileSync(resolve(base), 'utf8');
|
|
1541
|
+
|
|
1542
|
+
if (enableCache) {
|
|
1543
|
+
readCache[str] = baseStr;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
options.content = content;
|
|
1547
|
+
content = reactBaseTmpl(baseStr, options);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
cb(null, content);
|
|
1551
|
+
|
|
1552
|
+
} catch (err) {
|
|
1553
|
+
cb(err);
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
/**
|
|
1560
|
+
* React JS Support
|
|
1561
|
+
*/
|
|
1562
|
+
exports.react = reactRenderer('path');
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* React JS string support.
|
|
1566
|
+
*/
|
|
1567
|
+
exports.react.render = reactRenderer('string');
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* ARC-templates support.
|
|
1571
|
+
*/
|
|
1572
|
+
|
|
1573
|
+
exports['arc-templates'] = fromStringRenderer('arc-templates');
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* ARC-templates string support.
|
|
1577
|
+
*/
|
|
1578
|
+
|
|
1579
|
+
exports['arc-templates'].render = function(str, options, cb) {
|
|
1580
|
+
var readFileWithOptions = Promise.promisify(read);
|
|
1581
|
+
var consolidateFileSystem = {};
|
|
1582
|
+
consolidateFileSystem.readFile = function(path) {
|
|
1583
|
+
return readFileWithOptions(path, options);
|
|
1584
|
+
};
|
|
1585
|
+
|
|
1586
|
+
return promisify(cb, function(cb) {
|
|
1587
|
+
try {
|
|
1588
|
+
var engine = requires['arc-templates'];
|
|
1589
|
+
if (!engine) {
|
|
1590
|
+
var Engine = require('arc-templates/dist/es5');
|
|
1591
|
+
engine = requires['arc-templates'] = new Engine({ filesystem: consolidateFileSystem });
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
var compiler = cache(options) || cache(options, engine.compileString(str, options.filename));
|
|
1595
|
+
compiler.then(function(func) { return func(options); })
|
|
1596
|
+
.then(function(result) { cb(null, result.content); })
|
|
1597
|
+
.catch(cb);
|
|
1598
|
+
} catch (err) {
|
|
1599
|
+
cb(err);
|
|
1600
|
+
}
|
|
1601
|
+
});
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* Vash support
|
|
1606
|
+
*/
|
|
1607
|
+
exports.vash = fromStringRenderer('vash');
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* Vash string support
|
|
1611
|
+
*/
|
|
1612
|
+
exports.vash.render = function(str, options, cb) {
|
|
1613
|
+
return promisify(cb, function(cb) {
|
|
1614
|
+
var engine = requires.vash || (requires.vash = require('vash'));
|
|
1615
|
+
|
|
1616
|
+
try {
|
|
1617
|
+
// helper system : https://github.com/kirbysayshi/vash#helper-system
|
|
1618
|
+
if (options.helpers) {
|
|
1619
|
+
for (var key in options.helpers) {
|
|
1620
|
+
if (!options.helpers.hasOwnProperty(key) || typeof options.helpers[key] !== 'function') {
|
|
1621
|
+
continue;
|
|
1622
|
+
}
|
|
1623
|
+
engine.helpers[key] = options.helpers[key];
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
1628
|
+
tmpl(options, function sealLayout(err, ctx) {
|
|
1629
|
+
if (err) cb(err);
|
|
1630
|
+
ctx.finishLayout();
|
|
1631
|
+
cb(null, ctx.toString().replace(/\n$/, ''));
|
|
1632
|
+
});
|
|
1633
|
+
} catch (err) {
|
|
1634
|
+
cb(err);
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Slm support.
|
|
1641
|
+
*/
|
|
1642
|
+
|
|
1643
|
+
exports.slm = fromStringRenderer('slm');
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* Slm string support.
|
|
1647
|
+
*/
|
|
1648
|
+
|
|
1649
|
+
exports.slm.render = function(str, options, cb) {
|
|
1650
|
+
return promisify(cb, function(cb) {
|
|
1651
|
+
var engine = requires.slm || (requires.slm = require('slm'));
|
|
1652
|
+
|
|
1653
|
+
try {
|
|
1654
|
+
var tmpl = cache(options) || cache(options, engine.compile(str, options));
|
|
1655
|
+
cb(null, tmpl(options));
|
|
1656
|
+
} catch (err) {
|
|
1657
|
+
cb(err);
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1660
|
+
};
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Marko support.
|
|
1664
|
+
*/
|
|
1665
|
+
|
|
1666
|
+
exports.marko = function(path, options, cb) {
|
|
1667
|
+
return promisify(cb, function(cb) {
|
|
1668
|
+
var engine = requires.marko || (requires.marko = require('marko'));
|
|
1669
|
+
options.writeToDisk = !!options.cache;
|
|
1670
|
+
|
|
1671
|
+
try {
|
|
1672
|
+
var tmpl = cache(options) || cache(options, engine.load(path, options));
|
|
1673
|
+
tmpl.renderToString(options, cb);
|
|
1674
|
+
} catch (err) {
|
|
1675
|
+
cb(err);
|
|
1676
|
+
}
|
|
1677
|
+
});
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Marko string support.
|
|
1682
|
+
*/
|
|
1683
|
+
|
|
1684
|
+
exports.marko.render = function(str, options, cb) {
|
|
1685
|
+
return promisify(cb, function(cb) {
|
|
1686
|
+
var engine = requires.marko || (requires.marko = require('marko'));
|
|
1687
|
+
options.writeToDisk = !!options.cache;
|
|
1688
|
+
options.filename = options.filename || 'string.marko';
|
|
1689
|
+
|
|
1690
|
+
try {
|
|
1691
|
+
var tmpl = cache(options) || cache(options, engine.load(options.filename, str, options));
|
|
1692
|
+
tmpl.renderToString(options, cb);
|
|
1693
|
+
} catch (err) {
|
|
1694
|
+
cb(err);
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Teacup support.
|
|
1701
|
+
*/
|
|
1702
|
+
exports.teacup = function(path, options, cb) {
|
|
1703
|
+
return promisify(cb, function(cb) {
|
|
1704
|
+
var engine = requires.teacup || (requires.teacup = require('teacup/lib/express'));
|
|
1705
|
+
require.extensions['.teacup'] = require.extensions['.coffee'];
|
|
1706
|
+
if (path[0] !== '/') {
|
|
1707
|
+
path = join(process.cwd(), path);
|
|
1708
|
+
}
|
|
1709
|
+
if (!options.cache) {
|
|
1710
|
+
var callback = cb;
|
|
1711
|
+
cb = function() {
|
|
1712
|
+
delete require.cache[path];
|
|
1713
|
+
callback.apply(this, arguments);
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
engine.renderFile(path, options, cb);
|
|
1717
|
+
});
|
|
1718
|
+
};
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* Teacup string support.
|
|
1722
|
+
*/
|
|
1723
|
+
exports.teacup.render = function(str, options, cb) {
|
|
1724
|
+
var coffee = require('coffee-script');
|
|
1725
|
+
var vm = require('vm');
|
|
1726
|
+
var sandbox = {
|
|
1727
|
+
module: {exports: {}},
|
|
1728
|
+
require: require
|
|
1729
|
+
};
|
|
1730
|
+
return promisify(cb, function(cb) {
|
|
1731
|
+
vm.runInNewContext(coffee.compile(str), sandbox);
|
|
1732
|
+
var tmpl = sandbox.module.exports;
|
|
1733
|
+
cb(null, tmpl(options));
|
|
1734
|
+
});
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Squirrelly support.
|
|
1739
|
+
*/
|
|
1740
|
+
|
|
1741
|
+
exports.squirrelly = fromStringRenderer('squirrelly');
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Squirrelly string support.
|
|
1745
|
+
*/
|
|
1746
|
+
|
|
1747
|
+
exports.squirrelly.render = function(str, options, cb) {
|
|
1748
|
+
return promisify(cb, function(cb) {
|
|
1749
|
+
var engine = requires.squirrelly || (requires.squirrelly = require('squirrelly'));
|
|
1750
|
+
try {
|
|
1751
|
+
for (var partial in options.partials) {
|
|
1752
|
+
engine.definePartial(partial, options.partials[partial]);
|
|
1753
|
+
}
|
|
1754
|
+
for (var helper in options.helpers) {
|
|
1755
|
+
engine.defineHelper(helper, options.helpers[helper]);
|
|
1756
|
+
}
|
|
1757
|
+
var tmpl = cache(options) || cache(options, engine.Compile(str, options));
|
|
1758
|
+
cb(null, tmpl(options, engine));
|
|
1759
|
+
} catch (err) {
|
|
1760
|
+
cb(err);
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
};
|
|
1764
|
+
/**
|
|
1765
|
+
* Twing support.
|
|
1766
|
+
*/
|
|
1767
|
+
|
|
1768
|
+
exports.twing = fromStringRenderer('twing');
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Twing string support.
|
|
1772
|
+
*/
|
|
1773
|
+
|
|
1774
|
+
exports.twing.render = function(str, options, cb) {
|
|
1775
|
+
return promisify(cb, function(cb) {
|
|
1776
|
+
var engine = requires.twing || (requires.twing = require('twing'));
|
|
1777
|
+
try {
|
|
1778
|
+
new engine.TwingEnvironment(new engine.TwingLoaderNull()).createTemplate(str).then((twingTemplate) => {
|
|
1779
|
+
twingTemplate.render(options).then((rendTmpl) => {
|
|
1780
|
+
var tmpl = cache(options) || cache(options, rendTmpl);
|
|
1781
|
+
cb(null, tmpl);
|
|
1782
|
+
});
|
|
1783
|
+
});
|
|
1784
|
+
} catch (err) {
|
|
1785
|
+
cb(err);
|
|
1786
|
+
}
|
|
1787
|
+
});
|
|
1788
|
+
};
|
|
1789
|
+
/**
|
|
1790
|
+
* expose the instance of the engine
|
|
1791
|
+
*/
|
|
1792
|
+
exports.requires = requires;
|