ThinkJS 2.1 Documentationmore friendly, though not all features. At this time, Babel can help us to compile ES6 code to ES5 code. ## Features ## Using ES6/7 features Babel compile our code to ES5 so we don't need worry about writing sync code to handle them with async/await. Last, it can run in Node.js environment stably after Babel compiling. ## Supports TypeScript TypeScript is an free and open source programming language designed simple and effective. Node.js has supported much of ES6 features in the latest version. You can use Babel compile your code to support all features. ## Do Not Use constructor Method If you use ES6's0 码力 | 148 页 | 1.69 MB | 2 年前3
BabelJS Tutorial... ii 1. BabelJS — Overview ..... 1 Why BabelJS? ..... 1 What is Babel-Transpiler? ..... 2 What is Babel-polyfill? ..... 2 Features of BabelJS ..... 3 Advantages of using BabelJS 3. Babel — CLI ..... 9 4. BabelJS — ES6 Code Execution ..... 15 5. BabelJS — Project setup using Babel 6 ..... 20 Create Project Setup ..... 20 6. BabelJS — Project Setup Using Babel 7 .. .76 10. BabelJS — Transpile ES8 features to ES5.....79 String Padding.....79 11. BabelJS — Babel Plugins.....82 Classes - Transform-class-properties.....83 Exponentiation Operator - transfor0 码力 | 173 页 | 2.70 MB | 2 年前3
FISCO BCOS 1.3 中文文档} } } } ## 编译、部署合约 直接使用deploy.js,自动编译和部署合约。 # 进入合约所在目录 cd /mydata/FISCO-BCOS/tools/contract babel-node deploy.js HelloWorld #注意后面HelloWorld后面没有".sol" 输出,可看到合约地址,部署成功。 deploy.js .....Start demoHelloWorld.js ## 调用合约 执行合约调用程序 # 进入合约所在目录 cd /mydata/FISCO-BCOS/FISCO-BCOS/tools/contract babel-node demoHelloWorld.js ## 可看到合约调用成功 { HttpProvider: 'http://127.0.0.1:8545', Ouputpath: sendRawTransaction(config.account, config.privKey, SystemProxy.address, func, params); 工具使用方法 查看所有系统合约信息: babel-node tool.js SystemProxy 示例输出如下: { HttpProvider: 'http://127.0.0.1:8701', Ouputpath:0 码力 | 491 页 | 5.72 MB | 2 年前3
阮一峰 《ECMAScript 6入门》 第三版$ es-checker ___ Passes 24 feature Dectations Your runtime supports 57% of ECMAScript 6 ## Babel 转码器 Babel 是一个广泛使用的 ES6 转码器,可以将 ES6 代码转为 ES5 代码,从而在现有环境执行。这意味着,你可以用 ES6 的方式编写程序,又不用担心现有环境是否支持。下面是一个例子。 (item) { return item + 1; }); 上面的原始代码用了箭头函数,Babel 将其转为普通函数,就能在不支持箭头函数的 JavaScript 环境执行了。 ### 配置文件 .babelrc Babel 的配置文件是 .babelrc,存放在项目的根目录下。使用 Babel 的第一步,就是配置这个文件。 该文件用来设置转码规则和插件,基本格式如下。 { "presets": --save-dev babel-preset-latest # react 转码规则 $ npm install --save-dev babel-preset-react # 不同阶段语法提案的转码规则(共有4个阶段),选装一个 $ npm install --save-dev babel-preset-stage-0 $ npm install --save-dev babel-preset-stage-10 码力 | 679 页 | 2.66 MB | 2 年前3
ThinkJS 2.2 中文文档ES6/7 特性来开发项目可以大大提高开发效率,是趋势所在。并且新版的 Node.js 对 ES6 特性也有了较好的支持,即使有些特性还没有支持,也可以借助 Babel 编译来支持。 ## 特性 ## 使用 ES6/7 特性来开发项目 借助 Babel 编译,可以在项目中大胆使用 ES6/7 所有的特性,无需担心哪些特性当前版本不支持。尤其是使用 `async/await` 或者 `*/yield` class, export, let 以及 ES7 里的 async/await 等特性,虽然查询数据库和写入 Session 都是异步操作,但借助 async/await,代码都是同步书写的。最后使用 Babel 进行编译,就可以稳定运行在 Node.js 的环境中了。 ## 支持 TypeScript TypeScript 是一种由微软开发的自由和开源的编程语言。它是 JavaScript 的一个超 个空格作为缩进。 ## 使用 ES6 语法开发 ES6 中有大量的语法糖可以简化我们的代码,让代码更加简洁高效。 Node.js 最新版本已经较好的支持了 ES6 的语法,即使有些语法不支持,也可以通过 Babel 编译来支持。所以是时候使用 ES6 语法来开发项目了。 ## 不要使用 constructor 方法 使用 ES6 里的 class 来创建类的时候,可以使用 `constructor` 方法达到类实例化的时候自动调用。如:0 码力 | 277 页 | 3.61 MB | 2 年前3
RxJS Tutorialfolder: npm install --save-dev babel-loader @babel/core @babel/preset-env webpack webpack-cli webpack-dev-server E:\rxjsproj\npm install --save-dev babel-loader @babel/core @babel/preset-env webpack webpack-cli {"os":"win32","arch":"x64"} ) +webpack-dev-server@3.8.0 +babel-loader@8.0.6 +@babel/preset-env@7.6.0 + @babel/core@7.6.0 + webpack-cli@3.3.8 + webpack@4.39.3 added 675 packages from 373 "devDependencies": { "@babel/core": "^7.6.0", "@babel/preset-env": "^7.6.0", "babel-loader": "^8.0.6", "esm":0 码力 | 106 页 | 1.56 MB | 2 年前3
ThinkJS 2.2 Documentationmore friendly, though not all features. At this time, Babel can help us to compile ES6 code to ES5 code. ## Features ## Using ES6/7 features Babel compile our code to ES5 so we don't need worry about writing sync code to handle them with async/await. Last, it can run in Node.js environment stably after Babel compiling. ## Supports TypeScript TypeScript is an free and open source programming language designed simple and effective. Node.js has supported much of ES6 features in the latest version. You can use Babel compile your code to support all features. ## Do Not Use constructor Method If you use ES6's0 码力 | 156 页 | 2.62 MB | 2 年前3
《玩转webpack》 第二章 基础篇: webpack 基础用法去支持其它文件类型并且把它们转化成有效的模块,并且可以添加到依赖图中。 本身是一个函数,接受源文件作为参数,返回转换的结果。 ## 常见的 Loaders 有哪些? |名称|描述| |---|---| |babel-loader|转换ES6、ES7等JS新特性语法| |css-loader|支持.css文件的加载和解析| |less-loader|将less文件转换成css| |ts-loader|将TS转换成JS| OccurrenceOrderPlugin , SideEffectsFlagPlugin 和 TerserPlugin .| |none|不开启任何优化选项| ## 资源解析:解析 ES6 使用 babel-loader babel的配置文件是:.babelrc const path = require('path'); module.exports = { entry: ' use: 'babel-loader' + } + ] + } }; }; }; ## 资源解析:增加ES6的babel preset配置 { "presets": [ + ,[ @babel/preset-env0 码力 | 41 页 | 2.52 MB | 2 年前3
ThinkJS 3.0 中文文档Master 进程 ## Babel 转译 由于框架依赖的 Node 最低版本为 6.0.0,但这个版本还不支持 async/await,所以在项目里使用 async/await 时,需要借助 babel 转译。 Babel 会将 src/ 目录转译到 app/ 目录下,并添加 sourceMap 文件。 ## 关闭 Babel 转译 如果想关闭 Babel 转译,那么需要 Node 的版本大于 参数来关闭 Babel 转译。 thinkjs new demo -w; 其实使不使用 Babel 转译,其实只是入口文件里引用有一些区别。 - 有 Babel 转译的入口文件(development.js) const Application = require('thinkjs'); const babel = require('think-babel'); new Application({ ROOT_PATH: __姓名, watcher: watcher, transpiler: [ babel, { // 转译器,这里使用的是 babel,并指定转译参数 presets: ['think-node'] } ], notify: notify0 码力 | 129 页 | 2.12 MB | 2 年前3
Jinja2 Documentation Release 2.10#### I mport name: jinja2.ext.i18n The i18n extension can be used in combination with gettext or babel. If the i18n extension is enabled Jinja2 provides a trans statement that marks the wrapped string objects for functions with multiple string arguments). If Babel is installed, the babel integration can be used to extract strings for babel. For a web application that is available in multiple languages gettext functions and are fully supported by the babel extraction tool. They might not work as expected by other extraction tools in case you are not using Babel's. What’s the big difference between standard0 码力 | 148 页 | 475.08 KB | 2 年前3
共 517 条
- 1
- 2
- 3
- 4
- 5
- 6
- 52
相关搜索词













