FORMAT ALL THE THINGS

This commit is contained in:
Tianon Gravi
2015-02-12 13:42:10 -07:00
parent 34b38dc22d
commit a71fa247d9
108 changed files with 911 additions and 1881 deletions
+11 -26
View File
@@ -1,20 +1,10 @@
# What is Node.js?
Node.js is a software platform for scalable server-side and networking
applications. Node.js applications are written in JavaScript and can be run
within the Node.js runtime on Mac OS X, Windows, and Linux without changes.
Node.js is a software platform for scalable server-side and networking applications. Node.js applications are written in JavaScript and can be run within the Node.js runtime on Mac OS X, Windows, and Linux without changes.
Node.js applications are designed to maximize throughput and efficiency, using
non-blocking I/O and asynchronous events. Node.js applications run
single-threaded, although Node.js uses multiple threads for file and network
events. Node.js is commonly used for real-time applications due to its
asynchronous nature.
Node.js applications are designed to maximize throughput and efficiency, using non-blocking I/O and asynchronous events. Node.js applications run single-threaded, although Node.js uses multiple threads for file and network events. Node.js is commonly used for real-time applications due to its asynchronous nature.
Node.js internally uses the Google V8 JavaScript engine to execute code; a large
percentage of the basic modules are written in JavaScript. Node.js contains a
built-in, asynchronous I/O library for file, socket, and HTTP communication. The
HTTP and socket support allows Node.js to act as a web server without additional
software such as Apache.
Node.js internally uses the Google V8 JavaScript engine to execute code; a large percentage of the basic modules are written in JavaScript. Node.js contains a built-in, asynchronous I/O library for file, socket, and HTTP communication. The HTTP and socket support allows Node.js to act as a web server without additional software such as Apache.
> [wikipedia.org/wiki/Node.js](https://en.wikipedia.org/wiki/Node.js)
@@ -24,26 +14,21 @@ software such as Apache.
## Create a `Dockerfile` in your Node.js app project
FROM node:0.10-onbuild
# replace this with your application's default port
EXPOSE 8888
FROM node:0.10-onbuild
# replace this with your application's default port
EXPOSE 8888
You can then build and run the Docker image:
docker build -t my-nodejs-app .
docker run -it --rm --name my-running-app my-nodejs-app
docker build -t my-nodejs-app .
docker run -it --rm --name my-running-app my-nodejs-app
### Notes
The image assumes that your application has a file named
[`package.json`](https://docs.npmjs.com/files/package.json) listing its dependencies
and defining its [start
script](https://docs.npmjs.com/misc/scripts#default-values).
The image assumes that your application has a file named [`package.json`](https://docs.npmjs.com/files/package.json) listing its dependencies and defining its [start script](https://docs.npmjs.com/misc/scripts#default-values).
## Run a single Node.js script
For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Node.js script by using the
Node.js Docker image directly:
For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a Node.js script by using the Node.js Docker image directly:
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
+1 -2
View File
@@ -1,2 +1 @@
View [license information](https://github.com/joyent/node/blob/master/LICENSE)
for the software contained in this image.
View [license information](https://github.com/joyent/node/blob/master/LICENSE) for the software contained in this image.