随笔分类 -  Node.js

摘要:Since Node.js V8.0+, it introduces a 'util' libaray, which has a 'promisfy' function. It can conver a callback based function to promise based functio 阅读全文
posted @ 2017-08-18 02:14 Zhentiw 阅读(285) 评论(0) 推荐(0) 编辑
摘要:Learn how to setup an Nginx proxy server that sits in front of a Node.js app. You can use a proxy to control the flow of frontend requests hitting you 阅读全文
posted @ 2017-07-21 16:33 Zhentiw 阅读(250) 评论(0) 推荐(0) 编辑
摘要:In the past, you've needed to either write a package.json script or use the node_modules/.bin directory to access binaries installed in your node_modu 阅读全文
posted @ 2017-07-21 15:14 Zhentiw 阅读(155) 评论(0) 推荐(0) 编辑
摘要:As node projects evolve, new features are added all the time. This results in different errors or results as you're migrating from one version to anot 阅读全文
posted @ 2017-07-20 16:33 Zhentiw 阅读(166) 评论(0) 推荐(0) 编辑
摘要:When we try to do MongoDB opration, mongoose return Promise, we can use async/await to simply the code: The problme here is no error handling, we can 阅读全文
posted @ 2017-06-19 23:34 Zhentiw 阅读(296) 评论(0) 推荐(0) 编辑
摘要:Mixin works as a function. Here, we use include keyword to inlcude a mixin file. Exec a mixin function we can use '+': Define a mixin: Here we use som 阅读全文
posted @ 2017-06-19 22:48 Zhentiw 阅读(375) 评论(0) 推荐(0) 编辑
摘要:Mongoose has some hooks, for example: Before 'save' action, will trigger the function to generate the 'slug' JIT. 阅读全文
posted @ 2017-06-19 22:15 Zhentiw 阅读(239) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll show how to use yarn to alias the names of same npm libraries but install different versions. This could allow for easy migrating 阅读全文
posted @ 2017-06-13 01:22 Zhentiw 阅读(128) 评论(0) 推荐(0) 编辑
摘要:We can create Template Helpers, which can contains some common reuseable data and libs. Then you can define a locals data in middleware: Require helpe 阅读全文
posted @ 2017-06-12 21:08 Zhentiw 阅读(276) 评论(0) 推荐(0) 编辑
摘要:Looking at the follow code: 1. .wapper: div with wrapper class By defualt it consider as div class if you don't wirte div, just give a class name. 2. 阅读全文
posted @ 2017-06-12 03:57 Zhentiw 阅读(584) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll use cjs-to-es6 to convert CommonJS requires to ES6 imports. We'll also show how to convert over a exported default object to take 阅读全文
posted @ 2017-06-09 15:58 Zhentiw 阅读(303) 评论(0) 推荐(0) 编辑
摘要:Install: For example, we can store the sensitive information or env related information in a 'veriables.env' file: Then we can use dotenv to load thos 阅读全文
posted @ 2017-06-07 01:42 Zhentiw 阅读(433) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll show how to setup a .babelrc file with presets and plugins. Then create npm scripts that use babel-node and babel. With babel-pre 阅读全文
posted @ 2017-06-06 14:13 Zhentiw 阅读(230) 评论(0) 推荐(0) 编辑
摘要:In this lesson you will learn what a LoopBack model is, you will create a Product model using the LoopbBack CLI. The product model will be based off t 阅读全文
posted @ 2017-05-02 04:06 Zhentiw 阅读(198) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we will use Chai's request method to test our Node application's API responses.By the end of this lesson, you will know how to:- insta 阅读全文
posted @ 2017-04-29 01:29 Zhentiw 阅读(333) 评论(0) 推荐(0) 编辑
摘要:When developing responsive websites, you will constantly be resizing your browser to make sure your site is properly responding to all of the resizes. 阅读全文
posted @ 2017-04-18 14:58 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:LoopBack is a framework built on top of Express for creating APIs. It allows you to create end-to-end REST APIs that can access data from many data so 阅读全文
posted @ 2017-03-14 15:19 Zhentiw 阅读(147) 评论(0) 推荐(0) 编辑
摘要:In this lesson we will look at pulling out complex npm script logic into an external JavaScript file. Instead of writing bash scripts you can leverage 阅读全文
posted @ 2017-02-12 02:38 Zhentiw 阅读(382) 评论(0) 推荐(0) 编辑
摘要:In this lesson we will look at pulling out complex npm scripts into their own external bash scripts. This ends up simplifying your package.json file a 阅读全文
posted @ 2017-02-12 02:21 Zhentiw 阅读(243) 评论(0) 推荐(0) 编辑
摘要:A technique you might use once you start having lots of npm scripts is to use a node package that allows you to define your scripts in an external pac 阅读全文
posted @ 2017-02-12 02:05 Zhentiw 阅读(566) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示