diff --git a/index.ts b/index.ts index 2c652e0..9c941a2 100644 --- a/index.ts +++ b/index.ts @@ -4,6 +4,7 @@ import rimraf from 'rimraf'; import { readFileSync, writeFileSync } from 'fs'; import Handlebars from 'handlebars'; import mkdirp from 'mkdirp'; +import { range } from 'underscore'; const BUILD_DIR = join(__dirname, 'build'); const SRC_DIR = join(__dirname, 'src'); @@ -34,5 +35,8 @@ function renderTemplate(template: HandlebarsTemplateDelegate, value: number) { const template = Handlebars.compile(readFileSync(join(BUILD_DIR, 'template.html')).toString()); - renderTemplate(template, 123); + range(0, 10, 0.5).forEach((i) => { + console.log(i); + renderTemplate(template, i); + }); })(); diff --git a/package-lock.json b/package-lock.json index d607789..9624519 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1093,6 +1093,11 @@ "@types/node": "*" } }, + "@types/underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-ROHiJBeuXxVVaKm65tM/LHWlkcTFBQJqJgDB90Vj3fsl8Q290Z29cmEwnpvtlb0nSzuMIaIYWj0ZvmVgim8khA==" + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", @@ -6432,6 +6437,11 @@ } } }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", diff --git a/package.json b/package.json index 1d45bb0..7752e94 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@types/node": "^12.0.10", "@types/parcel-bundler": "^1.12.0", "@types/rimraf": "^2.0.2", + "@types/underscore": "^1.9.1", "animate.css": "3.7.0", "bootstrap": "4.2.1", "handlebars": "^4.1.2", @@ -29,7 +30,8 @@ "rimraf": "^2.6.3", "sass": "^1.22.1", "ts-node": "8.3.0", - "typescript": "3.5.2" + "typescript": "3.5.2", + "underscore": "^1.9.1" }, "devDependencies": { "tslint-config-dabapps": "github:dabapps/tslint-config-dabapps#v0.5.1",