Loading...
Buffer/Stream
Buffer
- Buffer
- Class: Buffer
- new Buffer(size)
- new Buffer(array)
- new Buffer(str, [encoding])
- buf.write(string, [offset], [length], [encoding])
- buf.toString([encoding], [start], [end])
- buf[index]
- Class Method: Buffer.isBuffer(obj)
- Class Method: Buffer.byteLength(string, [encoding])
- Class Method: Buffer.concat(list, [totalLength])
- buf.length
- buf.copy(targetBuffer, [targetStart], [sourceStart], [sourceEnd])
- buf.slice([start], [end])
- buf.readUInt8(offset, [noAssert])
- buf.readUInt16LE(offset, [noAssert])
- buf.readUInt16BE(offset, [noAssert])
- buf.readUInt32LE(offset, [noAssert])
- buf.readUInt32BE(offset, [noAssert])
- buf.readInt8(offset, [noAssert])
- buf.readInt16LE(offset, [noAssert])
- buf.readInt16BE(offset, [noAssert])
- buf.readInt32LE(offset, [noAssert])
- buf.readInt32BE(offset, [noAssert])
- buf.readFloatLE(offset, [noAssert])
- buf.readFloatBE(offset, [noAssert])
- buf.readDoubleLE(offset, [noAssert])
- buf.readDoubleBE(offset, [noAssert])
- buf.writeUInt8(value, offset, [noAssert])
- buf.writeUInt16LE(value, offset, [noAssert])
- buf.writeUInt16BE(value, offset, [noAssert])
- buf.writeUInt32LE(value, offset, [noAssert])
- buf.writeUInt32BE(value, offset, [noAssert])
- buf.writeInt8(value, offset, [noAssert])
- buf.writeInt16LE(value, offset, [noAssert])
- buf.writeInt16BE(value, offset, [noAssert])
- buf.writeInt32LE(value, offset, [noAssert])
- buf.writeInt32BE(value, offset, [noAssert])
- buf.writeFloatLE(value, offset, [noAssert])
- buf.writeFloatBE(value, offset, [noAssert])
- buf.writeDoubleLE(value, offset, [noAssert])
- buf.writeDoubleBE(value, offset, [noAssert])
- buf.fill(value, [offset], [end])
- buffer.INSPECT_MAX_BYTES
- Class: SlowBuffer
Domain
Crypto
- crypto.createCredentials(details)
- crypto.createHash(algorithm)
- Class: Hash
- hash.update(data, [input_encoding])
- hash.digest([encoding])
- crypto.createHmac(algorithm, key)
- Class: Hmac
- hmac.update(data)
- hmac.digest([encoding])
- crypto.createCipher(algorithm, password)
- crypto.createCipheriv(algorithm, key, iv)
- Class: Cipher
- cipher.update(data, [input_encoding], [output_encoding])
- cipher.final([output_encoding])
- cipher.setAutoPadding(auto_padding=true)
- crypto.createDecipher(algorithm, password)
- crypto.createDecipheriv(algorithm, key, iv)
- Class: Decipher
- decipher.update(data, [input_encoding], [output_encoding])
- decipher.final([output_encoding])
- decipher.setAutoPadding(auto_padding=true)
- crypto.createSign(algorithm)
- Class: Signer
- signer.update(data)
- signer.sign(private_key, [output_format])
- crypto.createVerify(algorithm)
- Class: Verify
- verifier.update(data)
- verifier.verify(object, signature, [signature_format])
- crypto.createDiffieHellman(prime_length)
- crypto.createDiffieHellman(prime, [encoding])
- Class: DiffieHellman
- diffieHellman.generateKeys([encoding])
- diffieHellman.computeSecret(other_public_key, [input_encoding], [output_encoding])
- diffieHellman.getPrime([encoding])
- diffieHellman.getGenerator([encoding])
- diffieHellman.getPublicKey([encoding])
- diffieHellman.getPrivateKey([encoding])
- diffieHellman.setPublicKey(public_key, [encoding])
- diffieHellman.setPrivateKey(public_key, [encoding])
- crypto.getDiffieHellman(group_name)
- crypto.pbkdf2(password, salt, iterations, keylen, callback)
- crypto.randomBytes(size, [callback])
TSL(SSL)
- Client-initiated renegotiation attack mitigation
- NPN and SNI
- tls.createServer(options, [secureConnectionListener])
- tls.connect(options, [secureConnectListener])
- tls.connect(port, [host], [options], [secureConnectListener])
- tls.createSecurePair([credentials], [isServer], [requestCert], [rejectUnauthorized])
- Class: SecurePair
- Event: 'secure'
- Class: tls.Server
- Event: 'secureConnection'
- Event: 'clientError'
- server.listen(port, [host], [callback])
- server.close()
- server.address()
- server.addContext(hostname, credentials)
- server.maxConnections
- server.connections
- Class: tls.CleartextStream
- Event: 'secureConnect'
- cleartextStream.authorized
- cleartextStream.authorizationError
- cleartextStream.getPeerCertificate()
- cleartextStream.getCipher()
- cleartextStream.address()
- cleartextStream.remoteAddress
- cleartextStream.remotePort
File
File System
- fs.rename(oldPath, newPath, [callback])
- fs.renameSync(oldPath, newPath)
- fs.truncate(fd, len, [callback])
- fs.truncateSync(fd, len)
- fs.chown(path, uid, gid, [callback])
- fs.chownSync(path, uid, gid)
- fs.fchown(fd, uid, gid, [callback])
- fs.fchownSync(fd, uid, gid)
- fs.lchown(path, uid, gid, [callback])
- fs.lchownSync(path, uid, gid)
- fs.chmod(path, mode, [callback])
- fs.chmodSync(path, mode)
- fs.fchmod(fd, mode, [callback])
- fs.fchmodSync(fd, mode)
- fs.lchmod(path, mode, [callback])
- fs.lchmodSync(path, mode)
- fs.stat(path, [callback])
- fs.lstat(path, [callback])
- fs.fstat(fd, [callback])
- fs.statSync(path)
- fs.lstatSync(path)
- fs.fstatSync(fd)
- fs.link(srcpath, dstpath, [callback])
- fs.linkSync(srcpath, dstpath)
- fs.symlink(destination, path, [type], [callback])
- fs.symlinkSync(destination, path, [type])
- fs.readlink(path, [callback])
- fs.readlinkSync(path)
- fs.realpath(path, [cache], callback)
- fs.realpathSync(path, [cache])
- fs.unlink(path, [callback])
- fs.unlinkSync(path)
- fs.rmdir(path, [callback])
- fs.rmdirSync(path)
- fs.mkdir(path, [mode], [callback])
- fs.mkdirSync(path, [mode])
- fs.readdir(path, [callback])
- fs.readdirSync(path)
- fs.close(fd, [callback])
- fs.closeSync(fd)
- fs.open(path, flags, [mode], [callback])
- fs.openSync(path, flags, [mode])
- fs.utimes(path, atime, mtime, [callback])
- fs.utimesSync(path, atime, mtime)
- fs.futimes(fd, atime, mtime, [callback])
- fs.futimesSync(fd, atime, mtime)
- fs.fsync(fd, [callback])
- fs.fsyncSync(fd)
- fs.write(fd, buffer, offset, length, position, [callback])
- fs.writeSync(fd, buffer, offset, length, position)
- fs.read(fd, buffer, offset, length, position, [callback])
- fs.readSync(fd, buffer, offset, length, position)
- fs.readFile(filename, [encoding], [callback])
- fs.readFileSync(filename, [encoding])
- fs.writeFile(filename, data, [encoding], [callback])
- fs.writeFileSync(filename, data, [encoding])
- fs.appendFile(filename, data, encoding='utf8', [callback])
- fs.appendFileSync(filename, data, encoding='utf8')
- fs.watchFile(filename, [options], listener)
- fs.unwatchFile(filename)
- fs.watch(filename, [options], [listener])
- Caveats
- Availability
- Filename Argument
- fs.exists(path, [callback])
- fs.existsSync(path)
- Class: fs.Stats
- fs.createReadStream(path, [options])
- Class: fs.ReadStream
- Event: 'open'
- fs.createWriteStream(path, [options])
- fs.WriteStream
- Event: 'open'
- file.bytesWritten
- Class: fs.FSWatcher
- watcher.close()
- Event: 'change'
- Event: 'error'
Net
net
- net.createServer([options], [connectionListener])
- net.connect(options, [connectionListener])
- net.createConnection(options, [connectionListener])
- net.connect(port, [host], [connectListener])
- net.createConnection(port, [host], [connectListener])
- net.connect(path, [connectListener])
- net.createConnection(path, [connectListener])
- Class: net.Server
- server.listen(port, [host], [backlog], [listeningListener])
- server.listen(path, [listeningListener])
- server.listen(handle, [listeningListener])
- server.close([cb])
- server.address()
- server.maxConnections
- server.connections
- Event: 'listening'
- Event: 'connection'
- Event: 'close'
- Event: 'error'
- Class: net.Socket
- new net.Socket([options])
- socket.connect(port, [host], [connectListener])
- socket.connect(path, [connectListener])
- socket.bufferSize
- socket.setEncoding([encoding])
- socket.write(data, [encoding], [callback])
- socket.end([data], [encoding])
- socket.destroy()
- socket.pause()
- socket.resume()
- socket.setTimeout(timeout, [callback])
- socket.setNoDelay([noDelay])
- socket.setKeepAlive([enable], [initialDelay])
- socket.address()
- socket.remoteAddress
- socket.remotePort
- socket.bytesRead
- socket.bytesWritten
- Event: 'connect'
- Event: 'data'
- Event: 'end'
- Event: 'timeout'
- Event: 'drain'
- Event: 'error'
- Event: 'close'
- net.isIP(input)
- net.isIPv4(input)
- net.isIPv6(input)
DNS
- dns.lookup(domain, [family], callback)
- dns.resolve(domain, [rrtype], callback)
- dns.resolve4(domain, callback)
- dns.resolve6(domain, callback)
- dns.resolveMx(domain, callback)
- dns.resolveTxt(domain, callback)
- dns.resolveSrv(domain, callback)
- dns.resolveNs(domain, callback)
- dns.resolveCname(domain, callback)
- dns.reverse(ip, callback)
- Error codes
HTTP
Class: http.ServerRequest
Class: http.ServerResponse
Class: http.ClientRequest
Code
Child Process
- Class: ChildProcess
- Event: 'exit'
- Event: 'close'
- Event: 'disconnect'
- Event: 'message'
- child.stdin
- child.stdout
- child.stderr
- child.pid
- child.kill([signal])
- child.send(message, [sendHandle])
- child.disconnect()
- child_process.spawn(command, [args], [options])
- child_process.exec(command, [options], callback)
- child_process.execFile(file, args, options, callback)
- child_process.fork(modulePath, [args], [options])
Assert
- assert.fail(actual, expected, message, operator)
- assert(value, message), assert.ok(value, [message])
- assert.equal(actual, expected, [message])
- assert.notEqual(actual, expected, [message])
- assert.deepEqual(actual, expected, [message])
- assert.notDeepEqual(actual, expected, [message])
- assert.strictEqual(actual, expected, [message])
- assert.notStrictEqual(actual, expected, [message])
- assert.throws(block, [error], [message])
- assert.doesNotThrow(block, [error], [message])
- assert.ifError(value)