Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yeoman print code character in templates

when i copy a template with this.copyTpl yeoman print code cacharter of quotes and not quotes ...here what im doing in index.js

this.dependencies["fontawesome"] = "4.2";
this.dependencies["jQuery"] = "~1.11.1";
this.dependencies["responsive-nav"] = "1.0.34";
this.dependencies["superfish"] = "1.7.5";

this.dep = JSON.stringify(this.dependencies); 

console.log(this.dep)
display 
{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"}

 this.fs.copyTpl(
            this.templatePath('_bower.json'),
            this.destinationPath(projectPath +'/bower.json'),{
                projectName: _.slugify(this.project_name),
                dependencies: this.dep
            }
        );

result file

{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"},

why this occurs, i need extra config where?? what i missing ?? thanks for help

like image 842
Pablo Enanoski Araya Avatar asked May 09 '16 01:05

Pablo Enanoski Araya


Video Answer


1 Answers

<%= escape values passed to it to prevent XSS.

To output raw input you need to use the <%- template tags.

Full documentation on the template engine used by Yeoman at http://ejs.co/

like image 50
Simon Boudrias Avatar answered Dec 28 '22 00:12

Simon Boudrias