1. 首页
  2. 数据库
  3. 其它
  4. iterable string interceptor:拦截可迭代的字符串 模板的主干 源码

iterable string interceptor:拦截可迭代的字符串 模板的主干 源码

上传者: 2021-04-20 05:58:59上传 ZIP文件 11.65KB 热度 8次
迭代字符串拦截器 拦截可迭代字符串-模板的主干 import { iterableStringInterceptor } from "iterable-string-interceptor" ; import { createReadStream } from "fs" ; // double values inside {{}} // {{7}} -> 14 for await ( const chunk of iterableStringInterceptor ( createReadStream ( 'aFile' , { encoding : "utf8" } ) , async * ( expression ) => { yield expression * 2 ; } ) ) { process . stdout . write ( chunk ) ; } import
下载地址
用户评论