Skip to content

Edits and revisions to README-content.md and README-short.txt. #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions node/README-content.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
# 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 with no 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, and 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 web server 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)

# How to use this image

## Create a `Dockerfile` in your nodejs app project.
## Create a `Dockerfile` in your Node.js app project.

FROM node:0.10.31-onbuild
# replace this with your application's default port
EXPOSE 8888

Then build and run the docker image.
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

### Notes

The image assumes that your application has a file named [`package.json`](https://www.npmjs.org/doc/json.html) listing its dependencies and defining its [start script](https://www.npmjs.org/doc/misc/npm-scripts.html#default-values).
The image assumes that your application has a file named
[`package.json`](https://www.npmjs.org/doc/json.html) listing its dependencies and
defining its
[start script](https://www.npmjs.org/doc/misc/npm-scripts.html#default-values).

## Run a single nodejs script
## Run a single Node.js script

For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a nodejs script by using the nodejs 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.31 node your-daemon-or-script.js
4 changes: 3 additions & 1 deletion node/README-short.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
The Official Build of Node.js. Node.js is a platform for scalable server-side and networking applications.
Node.js is a software platform for scalable server-side and networking applications.
Node.js applications are written in JavaScript and run within the Node.js runtime
on Mac OS X, Windows, and Linux.