pax_global_header 0000666 0000000 0000000 00000000064 15261022330 0014504 g ustar 00root root 0000000 0000000 52 comment=45ce15255e0f430ac6d19742b18e316b7539264e handlebars-lang-handlebars.js-0cbc8e4/ 0000775 0000000 0000000 00000000000 15261022330 0017734 5 ustar 00root root 0000000 0000000 handlebars-lang-handlebars.js-0cbc8e4/.editorconfig 0000664 0000000 0000000 00000000265 15261022330 0022414 0 ustar 00root root 0000000 0000000 root = true [*.js] indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true [*.yml] indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true handlebars-lang-handlebars.js-0cbc8e4/.eslintignore 0000664 0000000 0000000 00000000533 15261022330 0022440 0 ustar 00root root 0000000 0000000 .rvmrc .DS_Store /tmp/ *.sublime-project *.sublime-workspace npm-debug.log .idea yarn-error.log node_modules /handlebars-release.tgz .nyc_output # Generated files lib/handlebars/compiler/parser.js /coverage/ /dist/ /tests/integration/*/dist/ # Third-party or files that must remain unchanged /spec/expected/ /spec/vendor # JS-Snippets src/*.js handlebars-lang-handlebars.js-0cbc8e4/.eslintrc.js 0000664 0000000 0000000 00000003116 15261022330 0022174 0 ustar 00root root 0000000 0000000 module.exports = { extends: ['eslint:recommended', 'plugin:compat/recommended', 'prettier'], globals: { self: false }, env: { node: true, es6: true }, rules: { 'no-console': 'warn', // temporarily disabled until the violating places are fixed. 'no-func-assign': 'off', 'no-sparse-arrays': 'off', // Best Practices // //----------------// 'default-case': 'warn', 'guard-for-in': 'warn', 'no-alert': 'error', 'no-caller': 'error', 'no-div-regex': 'warn', 'no-eval': 'error', 'no-extend-native': 'error', 'no-extra-bind': 'error', 'no-floating-decimal': 'error', 'no-implied-eval': 'error', 'no-iterator': 'error', 'no-labels': 'error', 'no-lone-blocks': 'error', 'no-loop-func': 'error', 'no-multi-str': 'warn', 'no-global-assign': 'error', 'no-new': 'error', 'no-new-func': 'error', 'no-new-wrappers': 'error', 'no-octal-escape': 'error', 'no-process-env': 'error', 'no-proto': 'error', 'no-return-assign': 'error', 'no-script-url': 'error', 'no-self-compare': 'error', 'no-sequences': 'error', 'no-throw-literal': 'error', 'no-unused-expressions': 'error', 'no-warning-comments': 'warn', 'no-with': 'error', radix: 'error', // Variables // //-----------// 'no-label-var': 'error', 'no-undef-init': 'error', 'no-use-before-define': ['error', 'nofunc'], // ECMAScript 6 // //--------------// 'no-var': 'error' }, parserOptions: { sourceType: 'module', ecmaVersion: 6, ecmaFeatures: {} } }; handlebars-lang-handlebars.js-0cbc8e4/.gitattributes 0000664 0000000 0000000 00000000226 15261022330 0022627 0 ustar 00root root 0000000 0000000 # Handlebars-template fixtures in test cases need deterministic eol *.handlebars text eol=lf *.hbs text eol=lf # Lexer files as well *.l text eol=lf handlebars-lang-handlebars.js-0cbc8e4/.github/ 0000775 0000000 0000000 00000000000 15261022330 0021274 5 ustar 00root root 0000000 0000000 handlebars-lang-handlebars.js-0cbc8e4/.github/dependabot.yml 0000664 0000000 0000000 00000000266 15261022330 0024130 0 ustar 00root root 0000000 0000000 version: 2 updates: - package-ecosystem: npm directory: "/" open-pull-requests-limit: 0 schedule: interval: weekly allow: - dependency-type: production handlebars-lang-handlebars.js-0cbc8e4/.github/workflows/ 0000775 0000000 0000000 00000000000 15261022330 0023331 5 ustar 00root root 0000000 0000000 handlebars-lang-handlebars.js-0cbc8e4/.github/workflows/ci.yml 0000664 0000000 0000000 00000003644 15261022330 0024456 0 ustar 00root root 0000000 0000000 name: CI on: push: branches: - master pull_request: {} jobs: lint: name: Lint runs-on: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '16' - name: Install dependencies run: npm ci - name: Lint run: npm run lint test: name: Test (Node) runs-on: ${{ matrix.operating-system }} strategy: fail-fast: false matrix: operating-system: ['ubuntu-latest', 'windows-latest'] # https://nodejs.org/en/about/releases/ node-version: ['16', '18', '20', '22'] steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm ci - name: Test run: npm run test - name: Test (Integration) # https://github.com/webpack/webpack/issues/14532 if: ${{ matrix.node-version == '16' }} run: | cd ./tests/integration/rollup-test && ./test.sh && cd - cd ./tests/integration/webpack-babel-test && ./test.sh && cd - cd ./tests/integration/webpack-test && ./test.sh && cd - browser: name: Test (Browser) runs-on: 'ubuntu-22.04' steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '16' - name: Install dependencies run: npm ci - name: Install Playwright run: | npx playwright install-deps npx playwright install - name: Build run: npx grunt prepare - name: Test run: npm run test:browser handlebars-lang-handlebars.js-0cbc8e4/.github/workflows/release.yml 0000664 0000000 0000000 00000001605 15261022330 0025476 0 ustar 00root root 0000000 0000000 name: Release on: workflow_dispatch: push: branches: - master tags: - '*' jobs: publish-aws-s3: name: Publish to AWS S3 runs-on: 'ubuntu-latest' environment: 'builds.handlebarsjs.com.s3.amazonaws.com' steps: - name: Checkout uses: actions/checkout@v2 with: submodules: true - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: '16' - name: Install dependencies run: npm ci - name: Publish run: | git config --global user.email "release@handlebarsjs.com" git config --global user.name "handlebars-lang" npm run publish:aws env: S3_BUCKET_NAME: "builds.handlebarsjs.com" S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} handlebars-lang-handlebars.js-0cbc8e4/.gitignore 0000664 0000000 0000000 00000000432 15261022330 0021723 0 ustar 00root root 0000000 0000000 .rvmrc .DS_Store /tmp/ *.sublime-project *.sublime-workspace npm-debug.log .idea /yarn-error.log /yarn.lock node_modules /handlebars-release.tgz .nyc_output # Generated files lib/handlebars/compiler/parser.js /coverage/ /dist/ /test-results/ /tests/integration/*/dist/ /spec/tmp/* handlebars-lang-handlebars.js-0cbc8e4/.gitmodules 0000664 0000000 0000000 00000000136 15261022330 0022111 0 ustar 00root root 0000000 0000000 [submodule "spec/mustache"] path = spec/mustache url = https://github.com/mustache/spec.git handlebars-lang-handlebars.js-0cbc8e4/.prettierignore 0000664 0000000 0000000 00000000526 15261022330 0023002 0 ustar 00root root 0000000 0000000 .rvmrc .DS_Store /tmp/ *.sublime-project *.sublime-workspace npm-debug.log sauce_connect.log* .idea yarn-error.log node_modules /handlebars-release.tgz .nyc_output # Generated files lib/handlebars/compiler/parser.js /coverage/ /dist/ /tests/integration/*/dist/ # Third-party or files that must remain unchanged /spec/expected/ /spec/vendor handlebars-lang-handlebars.js-0cbc8e4/CONTRIBUTING.md 0000664 0000000 0000000 00000022113 15261022330 0022164 0 ustar 00root root 0000000 0000000 # How to Contribute ## Reporting Issues Please see our [FAQ](https://github.com/handlebars-lang/handlebars.js/blob/master/FAQ.md) for common issues that people run into. Should you run into other issues with the project, please don't hesitate to let us know by filing an [issue][issue]! In general we are going to ask for an example of the problem failing, which can be as simple as a jsfiddle/jsbin/etc. We've put together a jsfiddle [template][jsfiddle] to ease this. (We will keep this link up to date as new releases occur, so feel free to check back here) Pull requests containing only failing tests demonstrating the issue are welcomed and this also helps ensure that your issue won't regress in the future once it's fixed. Documentation issues on the [handlebarsjs.com](https://handlebarsjs.com) site should be reported on [handlebars-lang/docs](https://github.com/handlebars-lang/docs). ## Branches - The branch `4.x` contains the currently released version. Bugfixes should be made in this branch. - The branch `master` contains the next version. A release date is not yet specified. Maintainers should merge the branch `4.x` into the master branch regularly. ## Pull Requests We also accept [pull requests][pull-request]! Generally we like to see pull requests that - Maintain the existing code style - Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request) - Have [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - Have tests - Don't significantly decrease the current code coverage (see coverage/lcov-report/index.html) ## Building To build Handlebars.js you'll need a few things installed. - Node.js - [Grunt](http://gruntjs.com/getting-started) Before building, you need to make sure that the Git submodule `spec/mustache` is included (i.e. the directory `spec/mustache` should not be empty). To include it, if using Git version 1.6.5 or newer, use `git clone --recursive` rather than `git clone`. Or, if you already cloned without `--recursive`, use `git submodule update --init`. Project dependencies may be installed via `npm install`. To build Handlebars.js from scratch, you'll want to run `grunt` in the root of the project. That will build Handlebars and output the results to the dist/ folder. To re-run tests, run `grunt test` or `npm test`. You can also run our set of benchmarks with `grunt bench`. The `grunt dev` implements watching for tests and allows for in browser testing at `http://localhost:9999/spec/`. If you notice any problems, please report them to the GitHub issue tracker at [http://github.com/handlebars-lang/handlebars.js/issues](http://github.com/handlebars-lang/handlebars.js/issues). ## Running Tests To run tests locally, first install all dependencies. ```sh npm install ``` Clone the mustache specs into the spec/mustache folder. ```sh cd spec rm -r mustache git clone https://github.com/mustache/spec.git mustache ``` From the root directory, run the tests. ```sh npm test ``` ## Linting and Formatting Handlebars uses `eslint` to enforce best-practices and `prettier` to auto-format files. We do linting and formatting in two phases: - Committed files are linted and formatted in a pre-commit hook. In this stage eslint-errors are forbidden, while warnings are allowed. - The GitHub CI job also lints all files and checks if they are formatted correctly. In this stage, warnings are forbidden. You can use the following scripts to make sure that the CI job does not fail: - **npm run lint** will run `eslint` and fail on warnings - **npm run format** will run `prettier` on all files - **npm run check-before-pull-request** will perform all most checks that our CI job does in its build-job, excluding the "integration-test". - **npm run test:integration** will run integration tests (using old NodeJS versions and integrations with webpack, babel and so on) These tests only work on a Linux-machine with `nvm` installed (for running tests in multiple versions of NodeJS). ## Releasing the latest version Before attempting the release Handlebars, please make sure that you have the following authorizations: - Push-access to [handlebars-lang/handlebars.js](https://github.com/handlebars-lang/handlebars.js/) - Publishing rights on npmjs.com for the [handlebars](https://www.npmjs.com/package/handlebars) package - Publishing rights on rubygems for the [handlebars-source](https://rubygems.org/gems/handlebars-source) package - Push-access to the repo for legacy package managers: [components/handlebars.js](https://github.com/components/handlebars.js) - Push-access to the production-repo of the handlebars site: [handlebars-lang/docs](https://github.com/handlebars-lang/docs) _When releasing a previous version of Handlebars, please look into the CONTRIBUNG.md in the corresponding branch._ A full release via Docker may be completed with the following: 1. Create a `Dockerfile` in this folder for releasing ```Dockerfile FROM node:10-slim ENV EDITOR=vim # Update stretch repositories RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \ -e 's|security.debian.org|archive.debian.org/|g' \ -e '/stretch-updates/d' /etc/apt/sources.list # Install release dependencies RUN apt-get update RUN apt-get install -y git vim # Work around deprecated npm dependency install via unauthenticated git-protocol: # https://github.com/kpdecker/generator-release/blob/87aab9b84c9f083635c3fcc822f18acce1f48736/package.json#L31 RUN git config --system url."https://github.com/".insteadOf git://github.com/ # Configure git RUN git config --system user.email "release@handlebarsjs.com" RUN git config --system user.name "handlebars-lang" RUN mkdir /home/node/.config RUN mkdir /home/node/.ssh RUN mkdir /home/node/tmp # Generate config for yo generator-release: # https://github.com/kpdecker/generator-release#example # You have to add a valid GitHub access token! (Used for reading issues and pull requests.) RUN echo "module.exports = {\n auth: 'oauth',\n token: 'GitHub personal access token'\n};" > /home/node/.config/generator-release RUN chown -R node:node /home/node/.config RUN chown -R node:node /home/node/.ssh RUN chown -R node:node /home/node/tmp # Add the generated key to GitHub: https://github.com/settings/keys RUN ssh-keygen -q -t ed25519 -N '' -f /home/node/.ssh/id_ed25519 -C "release@handlebarsjs.com" RUN chmod 0600 /home/node/.ssh/id_ed25519* RUN chown node:node /home/node/.ssh/id_ed25519* ``` 2. Build and run the Docker image ```bash docker build --tag handlebars:release . docker run --rm --interactive --tty \ --volume $PWD:/app \ --workdir /app \ --user $(id -u):$(id -g) \ --env NPM_CONFIG_PREFIX=/home/node/.npm-global \ handlebars:release bash -c 'export PATH=$PATH:/home/node/.npm-global/bin; bash' ``` * Add SSH key to GitHub: `cat /home/node/.ssh/id_ed25519.pub` (https://github.com/settings/keys) * Add GitHub API token: `vi /home/node/.config/generator-release` * Execute the following steps: ```bash npm install npm install -g yo@1 grunt@1 generator-release npm run release # Warning! This step will collect data from GitHub, bump the version, # create a new commit, create a new tag and push it to GitHub. # https://github.com/kpdecker/generator-release?tab=readme-ov-file#usage yo release npm login npm publish yo release:publish components handlebars.js dist/components/ ``` 6. Publish Ruby `handlebars-source` gem: ```bash docker run --rm --interactive --tty \ --volume $PWD:/app \ --workdir /app \ ruby:3.2-slim bash ``` * Execute the following steps: ```bash cd dist/components/ gem build handlebars-source.gemspec gem push handlebars-source-*.gem ``` ### After the release After the release, you should check that all places have really been updated. Especially verify that the `latest`-tags in those places still point to the latest version - [The npm-package](https://www.npmjs.com/package/handlebars) (check latest-tag) - [The bower package](https://github.com/components/handlebars.js) (check the package.json) - [The AWS S3 Bucket](https://s3.amazonaws.com/builds.handlebarsjs.com) (check latest-tag) - [RubyGems](https://rubygems.org/gems/handlebars-source) When everything is OK, the **handlebars site** needs to be updated. Go to the master branch of the repo [handlebars-lang/docs](https://github.com/handlebars-lang/docs/tree/master) and make a minimal change to the README. This will invoke a github-action that redeploys the site, fetching the latest version-number from the npm-registry. (note that the default-branch of this repo is not the master and regular changes are done in the `handlebars-lang/docs`-repo). [generator-release]: https://github.com/walmartlabs/generator-release [pull-request]: https://github.com/handlebars-lang/handlebars.js/pull/new/master [issue]: https://github.com/handlebars-lang/handlebars.js/issues/new [jsfiddle]: https://jsfiddle.net/9D88g/180/ handlebars-lang-handlebars.js-0cbc8e4/FAQ.md 0000664 0000000 0000000 00000007335 15261022330 0020675 0 ustar 00root root 0000000 0000000 # Frequently Asked Questions 1. How can I file a bug report: See our guidelines on [reporting issues](https://github.com/handlebars-lang/handlebars.js/blob/master/CONTRIBUTING.md#reporting-issues). 1. Why isn't my Mustache template working? Handlebars deviates from Mustache slightly on a few behaviors. These variations are documented in our [readme](https://github.com/handlebars-lang/handlebars.js#differences-between-handlebarsjs-and-mustache). 1. Why is it slower when compiling? The Handlebars compiler must parse the template and construct a JavaScript program which can then be run. Under some environments such as older mobile devices this can have a performance impact which can be avoided by precompiling. Generally it's recommended that precompilation and the runtime library be used on all clients. 1. Why doesn't this work with Content Security Policy restrictions? When not using the precompiler, Handlebars generates a dynamic function for each template which can cause issues with pages that have enabled Content Policy. It's recommended that templates are precompiled or the `unsafe-eval` policy is enabled for sites that must generate dynamic templates at runtime. 1. How can I include script tags in my template? If loading the template via an inlined ` ``` It's generally recommended that templates are served through external, precompiled, files, which do not suffer from this issue. 1. Why are my precompiled scripts throwing exceptions? When using the precompiler, it's important that a supporting version of the Handlebars runtime be loaded on the target page. In version 1.x there were rudimentary checks to compare the version but these did not always work. This is fixed under 2.x but the version checking does not work between these two versions. If you see unexpected errors such as `undefined is not a function` or similar, please verify that the same version is being used for both the precompiler and the client. This can be checked via: ```sh handlebars --version ``` If using the integrated precompiler and ```javascript console.log(Handlebars.VERSION); ``` On the client side. We include the built client libraries in the npm package for those who want to be certain that they are using the same client libraries as the compiler. Should these match, please file an issue with us, per our [issue filing guidelines](https://github.com/handlebars-lang/handlebars.js/blob/master/CONTRIBUTING.md#reporting-issues). 1. Why doesn't IE like the `default` name in the AMD module? Some browsers such as particular versions of IE treat `default` as a reserved word in JavaScript source files. To safely use this you need to reference this via the `Handlebars['default']` lookup method. This is an unfortunate side effect of the shims necessary to backport the Handlebars ES6 code to all current browsers. 1. How do I load the runtime library when using AMD? There are two options for loading under AMD environments. The first is to use the `handlebars.runtime.amd.js` file. This may require a [path mapping](https://github.com/handlebars-lang/handlebars.js/blob/master/spec/amd-runtime.html#L31) as well as access via the `default` field. The other option is to load the `handlebars.runtime.js` UMD build, which might not require path configuration and exposes the library as both the module root and the `default` field for compatibility. If not using ES6 transpilers or accessing submodules in the build the former option should be sufficient for most use cases. handlebars-lang-handlebars.js-0cbc8e4/Gruntfile.js 0000664 0000000 0000000 00000013053 15261022330 0022233 0 ustar 00root root 0000000 0000000 /* eslint-disable no-process-env */ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), clean: [ 'tmp', 'dist', 'lib/handlebars/compiler/parser.js', '/tests/integration/**/node_modules' ], copy: { dist: { options: { processContent: function(content) { return ( grunt.template.process( '/**!\n\n @license\n <%= pkg.name %> v<%= pkg.version %>\n\n<%= grunt.file.read("LICENSE") %>\n*/\n' ) + content ); } }, files: [{ expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/' }] }, cdnjs: { files: [ { expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/cdnjs' } ] }, components: { files: [ { expand: true, cwd: 'components/', src: ['**'], dest: 'dist/components' }, { expand: true, cwd: 'dist/', src: ['*.js'], dest: 'dist/components' } ] } }, babel: { options: { sourceMaps: 'inline', loose: ['es6.modules'], auxiliaryCommentBefore: 'istanbul ignore next' }, amd: { options: { modules: 'amd' }, files: [ { expand: true, cwd: 'lib/', src: '**/!(index).js', dest: 'dist/amd/' } ] }, cjs: { options: { modules: 'common' }, files: [ { cwd: 'lib/', expand: true, src: '**/!(index).js', dest: 'dist/cjs/' } ] } }, webpack: { options: { context: __dirname, module: { loaders: [ // the optional 'runtime' transformer tells babel to require the runtime instead of inlining it. { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?optional=runtime&loose=es6.modules&auxiliaryCommentBefore=istanbul%20ignore%20next' } ] }, output: { path: 'dist/', library: 'Handlebars', libraryTarget: 'umd' } }, handlebars: { entry: './lib/handlebars.js', output: { filename: 'handlebars.js' } }, runtime: { entry: './lib/handlebars.runtime.js', output: { filename: 'handlebars.runtime.js' } } }, requirejs: { options: { optimize: 'none', baseUrl: 'dist/amd/' }, dist: { options: { name: 'handlebars', out: 'dist/handlebars.amd.js' } }, runtime: { options: { name: 'handlebars.runtime', out: 'dist/handlebars.runtime.amd.js' } } }, uglify: { options: { mangle: true, compress: true, preserveComments: /(?:^!|@(?:license|preserve|cc_on))/ }, dist: { files: [ { cwd: 'dist/', expand: true, src: ['handlebars*.js', '!*.min.js'], dest: 'dist/', rename: function(dest, src) { return dest + src.replace(/\.js$/, '.min.js'); } } ] } }, concat: { tests: { src: ['spec/!(require).js'], dest: 'tmp/tests.js' } }, connect: { server: { options: { base: '.', hostname: '*', port: 9999 } } }, shell: { integrationTests: { command: './tests/integration/run-integration-tests.sh' } }, watch: { scripts: { options: { atBegin: true }, files: ['src/*', 'lib/**/*.js', 'spec/**/*.js'], tasks: ['on-file-change'] } } }); // Load tasks from npm grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-requirejs'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-babel'); grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-webpack'); grunt.task.loadTasks('tasks'); grunt.registerTask('node', ['babel:cjs']); grunt.registerTask('amd', ['babel:amd', 'requirejs']); grunt.registerTask('globals', ['webpack']); grunt.registerTask('release', 'Build final packages', [ 'uglify', 'test:min', 'copy:dist', 'copy:components', 'copy:cdnjs' ]); // Requires secret properties from .travis.yaml grunt.registerTask('extensive-tests-and-publish-to-aws', [ 'default', 'shell:integrationTests', 'metrics', 'publish-to-aws' ]); grunt.registerTask('on-file-change', ['build', 'concat:tests', 'test']); // === Primary tasks === grunt.registerTask('dev', ['clean', 'connect', 'watch']); grunt.registerTask('default', ['clean', 'build', 'test', 'release']); grunt.registerTask('test', ['test:bin', 'test:cov']); grunt.registerTask('bench', ['metrics']); grunt.registerTask('prepare', ['build', 'concat:tests']); grunt.registerTask( 'build', 'Builds a distributable version of the current project', ['parser', 'node', 'amd', 'globals'] ); grunt.registerTask('integration-tests', [ 'default', 'shell:integrationTests' ]); }; handlebars-lang-handlebars.js-0cbc8e4/LICENSE 0000664 0000000 0000000 00000002047 15261022330 0020744 0 ustar 00root root 0000000 0000000 Copyright (C) 2011-2019 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. handlebars-lang-handlebars.js-0cbc8e4/README.markdown 0000664 0000000 0000000 00000022016 15261022330 0022436 0 ustar 00root root 0000000 0000000 [](https://github.com/handlebars-lang/handlebars.js/actions/workflows/ci.yml) [](https://www.jsdelivr.com/package/npm/handlebars) [](https://www.npmjs.com/package/handlebars) [](https://www.npmjs.com/package/handlebars) [](https://bundlephobia.com/package/handlebars) [](https://packagephobia.com/result?p=handlebars) Handlebars.js ============= Handlebars provides the power necessary to let you build **semantic templates** effectively with no frustration. Handlebars is largely compatible with Mustache templates. In most cases it is possible to swap out Mustache with Handlebars and continue using your current templates. Checkout the official Handlebars docs site at [handlebarsjs.com](https://handlebarsjs.com) and try our [live demo](https://handlebarsjs.com/playground.html). Installing ---------- See our [installation documentation](https://handlebarsjs.com/installation/). Usage ----- In general, the syntax of Handlebars.js templates is a superset of Mustache templates. For basic syntax, check out the [Mustache manpage](https://mustache.github.io/mustache.5.html). Once you have a template, use the `Handlebars.compile` method to compile the template into a function. The generated function takes a context argument, which will be used to render the template. ```js var source = "
Hello, my name is {{name}}. I am from {{hometown}}. I have " + "{{kids.length}} kids:
" + "Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids:
//