Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: express-handlebars @ 3.0.0 .. 3.0.2

.idea/codeStyles/codeStyleConfig.xml

@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+ <state>
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
+ </state>
+</component>
\ No newline at end of file

.idea/encodings.xml

@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="Encoding">
- <file url="PROJECT" charset="UTF-8" />
- </component>
+ <component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file

.idea/express-handlebars.iml

@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
- <content url="file://$MODULE_DIR$" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
+ </content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="express-handlebars node_modules" level="project" />
</component>
</module>
\ No newline at end of file

.idea/jsLibraryMappings.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="JavaScriptLibraryMappings">
- <file url="file://$PROJECT_DIR$" libraries="{express-handlebars node_modules}" />
- </component>
-</project>
\ No newline at end of file

.idea/libraries/express_handlebars_node_modules.xml

@@ -1,14 +0,0 @@
-<component name="libraryTable">
- <library name="express-handlebars node_modules" type="javaScript">
- <properties>
- <option name="frameworkName" value="node_modules" />
- <sourceFilesUrls>
- <item url="file://$PROJECT_DIR$/node_modules" />
- </sourceFilesUrls>
- </properties>
- <CLASSES>
- <root url="file://$PROJECT_DIR$/node_modules" />
- </CLASSES>
- <SOURCES />
- </library>
-</component>
\ No newline at end of file

.idea/misc.xml

@@ -1,17 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="JsBowerSettings">
- <exe-path>/usr/local/bin/bower</exe-path>
- <config-path />
- </component>
- <component name="ProjectLevelVcsManager" settingsEditedManually="false">
- <OptionsSetting value="true" id="Add" />
- <OptionsSetting value="true" id="Remove" />
- <OptionsSetting value="true" id="Checkout" />
- <OptionsSetting value="true" id="Update" />
- <OptionsSetting value="true" id="Status" />
- <OptionsSetting value="true" id="Edit" />
- <ConfirmationsSetting value="0" id="Add" />
- <ConfirmationsSetting value="0" id="Remove" />
+ <component name="JavaScriptSettings">
+ <option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file

.idea/.name

@@ -1 +0,0 @@
-express-handlebars
\ No newline at end of file

.idea/workspace.xml

@@ -1,41 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
- <list default="true" id="ea8cf2ac-fdc7-42e9-932c-9eb161027e9b" name="Default" comment="" />
- <ignored path="express-handlebars.iws" />
- <ignored path=".idea/workspace.xml" />
+ <list default="true" id="84cdaacd-6587-4d6d-bffa-79e624beb812" name="Default Changelist" comment="" />
+ <ignored path="$PROJECT_DIR$/.tmp/" />
+ <ignored path="$PROJECT_DIR$/temp/" />
+ <ignored path="$PROJECT_DIR$/tmp/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
- <option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
- <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
- <component name="CreatePatchCommitExecutor">
- <option name="PATCH_PATH" value="" />
- </component>
- <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
- <component name="FavoritesManager">
- <favorites_list name="express-handlebars" />
- </component>
<component name="FileEditorManager">
- <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
- <file leaf-file-name="package.json" pinned="false" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/package.json">
+ <leaf>
+ <file pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/utils.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.6057692">
- <caret line="21" column="4" selection-start-line="21" selection-start-column="4" selection-end-line="21" selection-end-column="4" />
- <folding />
+ <state relative-caret-position="408">
+ <caret line="24" selection-start-line="24" selection-end-line="24" />
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="utils.js" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/lib/utils.js">
+ <file pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/express-handlebars.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <state relative-caret-position="225">
+ <caret line="194" column="23" selection-start-line="194" selection-start-column="23" selection-end-line="194" selection-end-column="23" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
@@ -43,201 +37,142 @@
</provider>
</entry>
</file>
+ <file pinned="false" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="51">
+ <caret line="3" column="19" selection-start-line="3" selection-start-column="19" selection-end-line="3" selection-end-column="19" />
+ </state>
+ </provider>
+ </entry>
+ </file>
</leaf>
</component>
+ <component name="FindInProjectRecents">
+ <findStrings>
+ <find>layoutsDir</find>
+ </findStrings>
+ </component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
+ <option value="$PROJECT_DIR$/lib/express-handlebars.js" />
<option value="$PROJECT_DIR$/package.json" />
</list>
</option>
</component>
- <component name="JsBuildToolGruntFileManager" detection-done="true" />
- <component name="JsBuildToolPackageJson" detection-done="true">
- <package-json value="$PROJECT_DIR$/package.json" />
- </component>
- <component name="JsGulpfileManager">
- <detection-done>true</detection-done>
- </component>
- <component name="ProjectFrameBounds">
- <option name="x" value="477" />
- <option name="y" value="165" />
- <option name="width" value="910" />
- <option name="height" value="638" />
- </component>
- <component name="ProjectLevelVcsManager" settingsEditedManually="false">
- <OptionsSetting value="true" id="Add" />
- <OptionsSetting value="true" id="Remove" />
- <OptionsSetting value="true" id="Checkout" />
- <OptionsSetting value="true" id="Update" />
- <OptionsSetting value="true" id="Status" />
- <OptionsSetting value="true" id="Edit" />
- <ConfirmationsSetting value="0" id="Add" />
- <ConfirmationsSetting value="0" id="Remove" />
+ <component name="ProjectFrameBounds" extendedState="6">
+ <option name="x" value="342" />
+ <option name="y" value="218" />
+ <option name="width" value="2052" />
+ <option name="height" value="1308" />
</component>
<component name="ProjectView">
- <navigator currentView="ProjectPane" proportions="" version="1">
- <flattenPackages />
- <showMembers />
- <showModules />
- <showLibraryContents />
- <hideEmptyPackages />
- <abbreviatePackageNames />
- <autoscrollToSource />
- <autoscrollFromSource />
- <sortByType />
- <manualOrder />
+ <navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="express-handlebars" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="express-handlebars" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="express-handlebars" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="express-handlebars" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="express-handlebars" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="lib" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
+ <expand>
+ <path>
+ <item name="express-handlebars" type="b2602c69:ProjectViewProjectNode" />
+ <item name="express-handlebars" type="462c0819:PsiDirectoryNode" />
+ </path>
+ <path>
+ <item name="express-handlebars" type="b2602c69:ProjectViewProjectNode" />
+ <item name="express-handlebars" type="462c0819:PsiDirectoryNode" />
+ <item name="lib" type="462c0819:PsiDirectoryNode" />
+ </path>
+ </expand>
+ <select />
</subPane>
</pane>
- <pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
- <property name="settings.editor.selected.configurable" value="configurable.group.tools" />
- <property name="settings.editor.splitter.proportion" value="0.2" />
- <property name="HbShouldOpenHtmlAsHb" value="" />
- <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="WebServerToolWindowFactoryState" value="false" />
- <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" />
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+ <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
+ <property name="nodejs_npm_path_reset_for_default_project" value="true" />
+ <property name="nodejs_package_manager_path" value="npm" />
+ <property name="settings.editor.selected.configurable" value="preferences.sourceCode" />
</component>
- <component name="RunManager">
- <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
- <method />
- </configuration>
- <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
- <method />
- </configuration>
- <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
- <envs />
- <method />
- </configuration>
- <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
- <method />
- </configuration>
- <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
- <method />
- </configuration>
- <configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
- <option name="cucumberJsArguments" value="" />
- <option name="executablePath" />
- <option name="filePath" />
- <method />
- </configuration>
- <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
- <method />
- </configuration>
- <configuration default="true" type="js.build_tools.npm" factoryName="npm">
- <command value="run-script" />
- <scripts />
- <envs />
- <method />
- </configuration>
- <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
- <node-options />
- <working-directory>$PROJECT_DIR$</working-directory>
- <pass-parent-env>true</pass-parent-env>
- <envs />
- <ui>bdd</ui>
- <extra-mocha-options />
- <test-kind>DIRECTORY</test-kind>
- <test-directory />
- <recursive>false</recursive>
- <method />
- </configuration>
+ <component name="RunDashboard">
+ <option name="ruleStates">
+ <list>
+ <RuleState>
+ <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+ </RuleState>
+ <RuleState>
+ <option name="name" value="StatusDashboardGroupingRule" />
+ </RuleState>
+ </list>
+ </option>
+ </component>
+ <component name="SvnConfiguration">
+ <configuration />
</component>
- <component name="ShelveChangesManager" show_recycled="false" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
- <changelist id="ea8cf2ac-fdc7-42e9-932c-9eb161027e9b" name="Default" comment="" />
- <created>1453315609358</created>
+ <changelist id="84cdaacd-6587-4d6d-bffa-79e624beb812" name="Default Changelist" comment="" />
+ <created>1551050846365</created>
<option name="number" value="Default" />
- <updated>1453315609358</updated>
+ <option name="presentableId" value="Default" />
+ <updated>1551050846365</updated>
+ <workItem from="1551050847759" duration="761000" />
</task>
<servers />
</component>
+ <component name="TimeTrackingManager">
+ <option name="totallyTimeSpent" value="761000" />
+ </component>
<component name="ToolWindowManager">
- <frame x="477" y="165" width="910" height="638" extended-state="0" />
+ <frame x="-6" y="-6" width="1381" height="885" extended-state="6" />
<editor active="true" />
<layout>
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24835165" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
- <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
- <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
- <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
- <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="npm" side_tool="true" />
+ <window_info id="Favorites" side_tool="true" />
+ <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24981412" />
+ <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+ <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
+ <window_info anchor="bottom" id="Version Control" />
+ <window_info anchor="bottom" id="Terminal" />
+ <window_info anchor="bottom" id="Event Log" side_tool="true" />
+ <window_info anchor="bottom" id="Message" order="0" />
+ <window_info anchor="bottom" id="Find" order="1" />
+ <window_info anchor="bottom" id="Run" order="2" />
+ <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
+ <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+ <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+ <window_info anchor="bottom" id="TODO" order="6" />
+ <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+ <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+ <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
- <component name="VcsContentAnnotationSettings">
- <option name="myLimit" value="2678400000" />
- </component>
- <component name="XDebuggerManager">
- <breakpoint-manager />
- <watches-manager />
+ <component name="TypeScriptGeneratedFilesManager">
+ <option name="version" value="1" />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/package.json">
+ <entry file="file://$PROJECT_DIR$/lib/utils.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- <folding />
+ <state relative-caret-position="408">
+ <caret line="24" selection-start-line="24" selection-end-line="24" />
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/utils.js">
+ <entry file="file://$PROJECT_DIR$/lib/express-handlebars.js">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <state relative-caret-position="225">
+ <caret line="194" column="23" selection-start-line="194" selection-start-column="23" selection-end-line="194" selection-end-column="23" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
@@ -246,9 +181,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/package.json">
<provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.6057692">
- <caret line="21" column="4" selection-start-line="21" selection-start-column="4" selection-end-line="21" selection-end-column="4" />
- <folding />
+ <state relative-caret-position="51">
+ <caret line="3" column="19" selection-start-line="3" selection-start-column="19" selection-end-line="3" selection-end-column="19" />
</state>
</provider>
</entry>

lib/express-handlebars.js

@@ -24,8 +24,8 @@
utils.assign(this, {
handlebars : Handlebars,
extname : '.handlebars',
- layoutsDir : 'views/layouts/',
- partialsDir : 'views/partials/',
+ layoutsDir : undefined, // Default layouts directory is relative to `express settings.view` + `layouts/`
+ partialsDir : undefined, // Default partials directory is relative to `express settings.view` + `partials/`
defaultLayout : undefined,
helpers : undefined,
compilerOptions: undefined,
@@ -185,11 +185,14 @@
// Express provides `settings.views` which is the path to the views dir that
// the developer set on the Express app. When this value exists, it's used
- // to compute the view's name.
+ // to compute the view's name. Layouts and Partials directories are relative
+ // to `settings.view` path
var view;
var viewsPath = options.settings && options.settings.views;
if (viewsPath) {
view = this._getTemplateName(path.relative(viewsPath, viewPath));
+ this.partialsDir = this.partialsDir || path.join(viewsPath, 'partials/');
+ this.layoutsDir = this.layoutsDir || path.join(viewsPath, 'layouts/');
}
// Merge render-level and instance-level helpers together.
@@ -236,7 +239,7 @@
// -- Protected Hooks ----------------------------------------------------------
ExpressHandlebars.prototype._compileTemplate = function (template, options) {
- return this.handlebars.compile(template, options);
+ return this.handlebars.compile(template.trim(), options);
};
ExpressHandlebars.prototype._precompileTemplate = function (template, options) {
@@ -244,7 +247,7 @@
};
ExpressHandlebars.prototype._renderTemplate = function (template, context, options) {
- return template(context, options);
+ return template(context, options).trim();
};
// -- Private ------------------------------------------------------------------

.npmignore

@@ -1 +0,0 @@
-examples/

package.json

@@ -1,7 +1,7 @@
{
"name": "express-handlebars",
"description": "A Handlebars view engine for Express which doesn't suck.",
- "version": "3.0.0",
+ "version": "3.0.2",
"homepage": "https://github.com/ericf/express-handlebars",
"keywords": [
"express",
@@ -24,11 +24,11 @@
"node": ">=0.10"
},
"dependencies": {
- "glob": "^6.0.4",
+ "glob": "^7.1.3",
"graceful-fs": "^4.1.2",
- "handlebars": "^4.0.5",
- "object.assign": "^4.0.3",
- "promise": "^7.0.0"
+ "handlebars": "^4.0.13",
+ "object.assign": "^4.1.0",
+ "promise": "^8.0.2"
},
"main": "index.js",
"directories": {

README.md

@@ -1,6 +1,8 @@
Express Handlebars
==================
+[![Join the chat at https://gitter.im/ericf/express-handlebars](https://badges.gitter.im/ericf/express-handlebars.svg)](https://gitter.im/ericf/express-handlebars?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
A [Handlebars][] view engine for [Express][] which doesn't suck.
[![npm version][npm-badge]][npm]
@@ -30,13 +32,13 @@
* Add back the concept of "partials" via Handlebars' partials mechanism.
-* Support a directories of partials; e.g., `{{> foo/bar}}` which exists on the file system at `views/partials/foo/bar.handlebars`, by default.
+* Support a directory of partials; e.g., `{{> foo/bar}}` which exists on the file system at `views/partials/foo/bar.handlebars`, by default.
* Smart file system I/O and template caching. When in development, templates are always loaded from disk. In production, raw files and compiled templates are cached, including partials.
* All async and non-blocking. File system I/O is slow and servers should not be blocked from handling requests while reading from disk. I/O queuing is used to avoid doing unnecessary work.
-* Ability to easily precompiled templates and partials for use on the client, enabling template sharing and reuse.
+* Ability to easily precompile templates and partials for use on the client, enabling template sharing and reuse.
* Ability to use a different Handlebars module/implementation other than the Handlebars npm package.
@@ -44,7 +46,7 @@
This package was designed to work great for both the simple and complex use cases. I _intentionally_ made sure the full implementation is exposed and is easily overridable.
-The package exports a function which can be invoked with no arguments or with a `config` object and it will return a function (closed over sane defaults) which can be registered with an Express app. It's an engine factory function.
+The package exports a function which can be invoked with no arguments or with a `config` object and it will return a function (closed over sensible defaults) which can be registered with an Express app. It's an engine factory function.
This exported engine factory has two properties which expose the underlying implementation:
@@ -66,7 +68,7 @@
## Usage
-This view engine uses sane defaults that leverage the "Express-way" of structuring an app's views. This makes it trivial to use in basic apps:
+This view engine uses sensible defaults that leverage the "Express-way" of structuring an app's views. This makes it trivial to use in basic apps:
### Basic Usage
@@ -183,7 +185,7 @@
A layout is simply a Handlebars template with a `{{{body}}}` placeholder. Usually it will be an HTML page wrapper into which views will be rendered.
-This view engine adds back the concept of "layout", which was removed in Express 3.x. It can be configured with a path to the layouts directory, by default it's set to `"views/layouts/"`.
+This view engine adds back the concept of "layout", which was removed in Express 3.x. It can be configured with a path to the layouts directory, by default it's set to relative to `express settings.view` + `layouts/`
There are two ways to set a default layout: configuring the view engine's `defaultLayout` property, or setting [Express locals][] `app.locals.layout`.
@@ -335,19 +337,21 @@
**Note:** Setting the app's `"view engine"` setting will make that value the default file extension used for looking up views.
-#### `layoutsDir="views/layouts/"`
+#### `layoutsDir`
+Default layouts directory is relative to `express settings.view` + `layouts/`
The string path to the directory where the layout templates reside.
-**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), you will need to reflect that by passing an updated path as the `layoutsDir` property in your configuration.
+**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), and if your `partialsDir` is not relative to `express settings.view` + `layouts/`, you will need to reflect that by passing an updated path as the `layoutsDir` property in your configuration.
-#### `partialsDir="views/partials/"`
+#### `partialsDir`
+Default partials directory is relative to `express settings.view` + `partials/`
The string path to the directory where the partials templates reside or object with the following properties:
* `dir`: The string path to the directory where the partials templates reside.
* `namespace`: Optional string namespace to prefix the partial names.
* `templates`: Optional collection (or promise of a collection) of templates in the form: `{filename: template}`.
-**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), you will need to reflect that by passing an updated path as the `partialsDir` property in your configuration.
+**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), and if your `partialsDir` is not relative to `express settings.view` + `partials/`, you will need to reflect that by passing an updated path as the `partialsDir` property in your configuration.
**Note:** Multiple partials dirs can be used by making `partialsDir` an array of strings, and/or config objects as described above. The namespacing feature is useful if multiple partials dirs are used and their file paths might clash.
@@ -435,7 +439,7 @@
* `[precompiled=false]`: Whether a precompiled template should be provided, instead of a compiled Handlebars template function.
#### `getTemplates(dirPath, [options])`
-Retrieves the all the templates in the specified `dirPath` and returns a Promise for an object mapping the compiled templates in the form `{filename: template}`.
+Retrieves all the templates in the specified `dirPath` and returns a Promise for an object mapping the compiled templates in the form `{filename: template}`.
Use `options.precompiled` to receive precompiled Handlebars templates — this is useful for sharing templates with client code.