Search code examples
yeomanyeoman-generator

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


Solution

  • <%= 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/