heredoc:npm模块

时间:2021-05-01 06:07:14
【文件属性】:
文件名称:heredoc:npm模块
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-01 06:07:14
JavaScript Heredoc JavaScript的多行字符串 用法 该技术利用了Function.prototype.toString() var heredoc = require ( 'heredoc' ) var str = heredoc ( function ( ) { /* within this comment block, any text will be treated as pre-formatted multiline text (kinda like html
)
    */ } )
    console . log ( str )
 您还可以去除前导缩进:
 var text = heredoc . strip ( function (     
     

    
【文件预览】:
heredoc-master
----.gitignore(24B)
----README.md(2KB)
----sample.js(215B)
----test()
--------test.heredoc.strip.js(2KB)
--------test.heredoc.js(535B)
--------.eslintrc(37B)
--------runner.html(323B)
--------runner.js(193B)
----package.json(769B)
----index.js(1KB)

网友评论