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 byte -- fs.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 -- Redirecting requests -- Location -- Implementing resource caching -- Handling file uploads -- Putting it all together -- Summary -- Chapter 5: Managing Many Simultaneous Client Connections -- Understanding concurrency -- Concurrency is not parallelism -- Routing requests -- Understanding routes -- Using Express to route requests -- Using Redis for tracking client state -- Storing user data -- Handling sessions -- Cookies and client state -- A simple poll -- Centralizing states -- Authenticating connections -- Basic authentication -- Handshaking. |