Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

package.json 2.1KB

Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
il y a 5 ans
Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
il y a 13 ans
il y a 11 ans
Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
il y a 14 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {
  2. "name": "mustache",
  3. "version": "4.2.0",
  4. "description": "Logic-less {{mustache}} templates with JavaScript",
  5. "author": "mustache.js Authors <http://github.com/janl/mustache.js>",
  6. "homepage": "https://github.com/janl/mustache.js",
  7. "repository": {
  8. "type": "git",
  9. "url": "https://github.com/janl/mustache.js.git"
  10. },
  11. "keywords": [
  12. "mustache",
  13. "template",
  14. "templates",
  15. "ejs"
  16. ],
  17. "main": "mustache.js",
  18. "bin": {
  19. "mustache": "./bin/mustache"
  20. },
  21. "files": [
  22. "bin/",
  23. "mustache.mjs",
  24. "mustache.min.js",
  25. "wrappers/"
  26. ],
  27. "exports": {
  28. ".": {
  29. "import": "./mustache.mjs",
  30. "require": "./mustache.js"
  31. },
  32. "./*": "./*"
  33. },
  34. "volo": {
  35. "url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js"
  36. },
  37. "scripts": {
  38. "build": "cp mustache.js mustache.mjs && rollup mustache.mjs --file mustache.js --format umd --name Mustache && uglifyjs mustache.js > mustache.min.js",
  39. "test": "npm run test-lint && npm run test-unit",
  40. "test-lint": "eslint mustache.js bin/mustache test/*.js test/**/*.js",
  41. "test-unit": "mocha --reporter spec test/*-test.js",
  42. "test-render": "mocha --reporter spec test/render-test",
  43. "pre-test-browser": "node test/create-browser-suite.js",
  44. "test-browser": "npm run pre-test-browser && zuul -- test/context-test.js test/parse-test.js test/scanner-test.js test/render-test-browser.js",
  45. "test-browser-local": "npm run pre-test-browser && zuul --local 8080 -- test/context-test.js test/scanner-test.js test/parse-test.js test/render-test-browser.js",
  46. "postversion": "scripts/bump-version-in-source",
  47. "prepublishOnly": "npm run build"
  48. },
  49. "devDependencies": {
  50. "chai": "^4.4.1",
  51. "eslint": "^8.57.0",
  52. "esm": "^3.2.25",
  53. "jshint": "^2.13.6",
  54. "mocha": "^10.4.0",
  55. "puppeteer": "^10.4.0",
  56. "rollup": "^4.17.2",
  57. "uglify-js": "^3.17.4",
  58. "zuul": "^3.12.0",
  59. "zuul-ngrok": "^4.0.0"
  60. },
  61. "overrides": {
  62. "zuul-ngrok": {
  63. "ngrok": "^4.3.3"
  64. }
  65. },
  66. "greenkeeper": {
  67. "ignore": [
  68. "eslint"
  69. ]
  70. },
  71. "license": "MIT"
  72. }