Introduction to Node.js(2)
1 How to recognize your Node.js files?
Node-js
|--- index.js
|--- server.js
index.js:
var server = require("./server.js");
server.start();
server.js:
var http = require("http");
function start() {
http.createServer(function(request, response) {
console.log("Receive a request.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8765, "127.0.0.1");
}
exports.start = start;
2 How to install an external module?
It’s very very easy. The only requirement is that your computer has been connected to Internet. The method to install Node.js modules is just like the way to install softwares on Linux using apt-get, or on Mac OS X using marport.
npm install SOME_MODULE
What does npm stand for?
Perhaps it is NodeJS Pakage Management.
3 How to use a module?
I guess you’ve already known that.
var yourModule = require("./someModule.js");
or
var module = require("module");
-
转载请注明来自柳大的CSDN博客:blog.csdn.net/poechant
-
分享到:
相关推荐
Chapter 1, Welcome to the Node.js Platform, serves as an introduction to the world of Node.js application design by showing the patterns at the core of the platform itself. It covers the Node.js ...
This book is the ideal introduction for JavaScript developers who want to create scalable server side applications using Node.js and Koa.js. The book shows you how Koa can be used to start projects ...
Using Node.js alongside Express and Pug - the brand new version of Jade - you can create modern web applications solely using JavaScript. This book teaches you how to structure and build your app ...
Part 1 provides an introduction to Node.js, teaching the fundamental techniques needed to develop with it. Chapter 1 explains the characteristics of JavaScript and Node and steps through example code....
The first chapter provides an overview of JavaScript and ES2015 for those of you who haven’t yet discovered the joys of modern JavaScript., Roadmap, This book is organized into three parts., Part 1 ...
JavaScript Applications with Node.js, React, React Native and MongoDB: Design, code, test, deploy and manage in Amazon AWS By 作者: Eric Bush ISBN-10 书号: 0997196661 ISBN-13 书号: 9780997196665 出版...
A practical introduction to Node.js, an exciting server-side JavaScript web development stack Overview Learn about server-side JavaScript with Node.js and Node modules. Website development both with...
Serverless Applications with Node.js walks you through building serverless apps on AWS using JavaScript. Inside, you'll discover what Claudia.js brings to the table as you build and deploy a scalable ...
Node.js has been designed to do quick and efficient network I/O. It's event-driven streams make it ideal to be used as a kind of smart proxy, often working as the glue between back-end systems and ...
This handbook is a getting started guide to Node.js, the server-side JavaScript runtime environment. The Node.js Handbook follows the 80/20 rule: learn in 20% of the time the 80% of a topic. Node.js ...
Rust ➡ WebAssembly Node.js Introduction to SSVM is a high performance, extensible, and hardware optimized WebAssembly Virtual Machine for cloud, AI, and blockchain applications.
Anode builds to an Android application package (.apk) that encapsulates the node.js runtime and can run node.js applications through an intent-based API. Status This work is at an early stage. All ...
Node.js简介 这是Node.js上LinuxFoundationX(edX)的类 第2章 固定服务器,模拟GET路由 文件夹的名称设置路由的路径前缀。 因此,如果我们使用fastify.get('/foo', …)设置GET /foo路由 在/confectionery/文件夹中...
7. An Introduction to Data Visualization with Vue and D3.js by Christopher Vundi 8. How to Build a Reusable Component with Vue by Deji Atoyebi 9. How to Build a Game with Vue.js by Ivaylo Gerchev 10. ...
Node.js,MongoDB和Meteor简介参加参与者对Node.js,MongoDB和Meteor的简要介绍 ###许可该源代码已获得GPL v3的许可。谢谢感谢所有贡献者
Introduction to RabbitMQ ....................................................10 Microservices and RabbitMQ ..................................... 12 What is RabbitMQ?......................................
This book starts off with an introduction to JavaScript security and gives you an overview of the basic functions JavaScript can perform on the Web, both on the client side and the server side....
An Introduction to Data Visualization with Vue and D3.js by Christopher Vundi How to Build a Reusable Component with Vue by Deji Atoyebi How to Build a Game with Vue.js by Ivaylo Gerchev Build a ...
Learn how to develop a complete and robust Node, express.js and MongoDB-based web application and mobile application backend quickly using KeystoneJS. You’ll learn how KeystoneJS makes complicated ...
The Third Edition also now includes Node.js along with Python. MongoDB is the most popular of the "Big Data" NoSQL database technologies, and it's still growing. David Hows from 10gen, along with ...