Cargando…

Mastering Node.js : expert techniques for building fast servers and scalable, real-time network applications with minimal effort /

This book contains an extensive set of practical examples and an easy-to-follow approach to creating 3D objects. This book is great for anyone who already knows JavaScript and who wants to start creating 3D graphics that run in any browser. You don't need to know anything about advanced math or...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Pasquali, Sandro (Software designer)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, UK : Packt Publishing, 2013.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Understanding the Node Environment; Extending JavaScript; Events; Modularity; The Network; V8; Memory and other limits; Harmony; The process object; The Read-Eval-Print Loop and executing a Node program; Summary; Chapter 2: Understanding Asynchronous Event-Driven Programming; Broadcasting events; Collaboration; Queueing; Listening for events; Signals; Forks; File events; Deferred execution; process.nextTick; Timers; setTimeout; setInterval; unref and ref.
  • Understanding the event loopFour sources of truth; Callbacks and errors; Conventions; Know your errors; Building pyramids; Considerations; Listening for file changes; Summary; Chapter 3: Streaming Data Across Nodes and Clients; Exploring streams; Implementing readable streams; Pushing and pulling; Writable streams; Duplex streams; Transforming streams; Using PassThrough streams; Creating an HTTP server; Making HTTP requests; Proxying and tunneling; HTTPS, TLS(SSL), and securing your server; Creating a self-signed certificate for development; Installing a real SSL certificate.
  • The request objectThe URL module; The Querystring module; Working with headers; Using cookies; Understanding content types; Handling favicon requests; Handling POST data; Creating and streaming images with Node; Creating, caching, and sending a PNG representation; Summary; Chapter 4: Using Node to Access the Filesystem; Directories, and iterating over files and folders; Types of files; File paths; File attributes; Opening and closing files; fs.open(path, flags, [mode], callback); fs.close(fd, callback); File operations; fs.rename(oldName, newName, callback); fs.truncate(path, len, callback).
  • Fs.ftruncate(fd, len, callback)fs.chown(path, uid, gid, callback); fs.fchown(fd, uid, gid, callback); fs.lchown(path, uid, gid, callback); fs.chmod(path, mode, callback); fs.fchmod(fd, mode, callback); fs.lchmod(path, mode, callback); fs.link(srcPath, dstPath, callback); fs.symlink(srcPath, dstPath, [type], callback); fs.readlink(path, callback); fs.realpath(path, [cache], callback); fs.unlink(path, callback); fs.rmdir(path, callback); fs.mkdir(path, [mode], callback); fs.exists(path, callback); fs.fsync(fd, callback); Synchronicity; Moving through directories; Reading from a file.
  • Reading byte by bytefs.read(fd, buffer, offset, length, position, callback); Fetching an entire file at once; fs.readFile(path, [options], callback); Creating a readable stream; fs.createReadStream(path, [options]); Reading a file line by line; The Readline module; Writing to a file; Writing byte by byte; fs.write(fd, buffer, offset, length, position, callback); Writing large chunks of data; fs.writeFile(path, data, [options], callback); fs.appendFile(path, data, [options], callback); Creating a writable stream; fs.createWriteStream(path, [options]); Caveats; Serving static files.