Node.js StringDecoder11 Jan 2025 | 1 min read The Node.js StringDecoder is used to decode buffer into string. It is similar to buffer.toString() but provides extra support to UTF. You need to use require('string_decoder') to use StringDecoder module. Node.js StringDecoder MethodsStringDecoder class has two methods only.
Node.js StringDecoder ExampleLet's see a simple example of Node.js StringDecoder. File: stringdecoder_example1.js ![]() Next TopicNode.js Query String |
The term REPL stands for Read Eval Print and Loop. It specifies a computer environment like a window console or a Unix/Linux shell where you can enter the commands and the system responds with an output in an interactive mode. REPL Environment The Node.js or node come...
2 min read
What is Punycode Punycode is an encoding syntax which is used to convert Unicode (UTF-8) string of characters to basic ASCII string of characters. Since host names only understand ASCII characters so Punycode is used. It is used as an internationalized domain name (IDN or IDNA). Let's...
1 min read
The Node.js console module provides a simple debugging console similar to JavaScript console mechanism provided by web browsers. There are three console methods that are used to write any node.js stream: console.log() console.error() console.warn() Node.js console.log() The console.log() function is used to display simple message on console. File: console_example1.js console.log('Hello JavaTpoint');...
1 min read
Node.js provides the facility to get process information such as process id, architecture, platform, version, release, uptime, upu usage etc. It can also be used to kill process, set uid, set groups, unmask etc. The process is a global object, an instance of EventEmitter, can be accessed...
2 min read
The Node.js applications generally face four types of errors: Standard JavaScript errors i.e. <EvalError>, <SyntaxError>, <RangeError>, <ReferenceError>, <TypeError>, <URIError> etc. System errors User-specified errors Assertion errors Example 1 Let's take an example to deploy standard JavaScript error - ReferenceError. File: error_example1.js // Throws with a ReferenceError because b is undefined try { ...
1 min read
Node.js Net Node.js provides the ability to perform socket programming. We can create chat application or communicate client and server applications using socket programming in Node.js. The Node.js net module contains functions for creating both servers and clients. Node.js Net Example In this example, we are using two...
1 min read
(FS) In Node.js, file I/O is provided by simple wrappers around standard POSIX functions. Node File System (fs) module can be imported using following syntax: Syntax: var fs = require("fs") Node.js FS Reading File Every method in fs module has synchronous and asynchronous forms. Asynchronous methods take a last...
3 min read
In Node.js applications, Events and Callbacks concepts are used to provide concurrency. As Node.js applications are single threaded and every API of Node js are asynchronous. So it uses async function to maintain the concurrency. Node uses observer pattern. Node thread keeps an event loop and...
2 min read
Install Node.js on Windows To install and setup an environment for Node.js, you need the following two softwares available on your computer: Text Editor. Node.js Binary installable Text Editor: The text editor is used to type your program. For example: Notepad is used in Windows, vim or vi...
1 min read
Callback is an asynchronous equivalent for a function. It is called at the completion of each task. In Node.js, callbacks are generally used. All APIs of Node are written in a way to supports callbacks. For example: when a function start reading file, it returns the...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India