Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Javascript Articles
Page 177 of 534
script.createCachedData() Method in Node.js
The script.createCachedData() method in Node.js creates a code cache for VM scripts, improving performance when executing the same script multiple times. This method is part of the vm module and generates cached bytecode that can be reused. Syntax script.createCachedData() Parameters This method takes no parameters. It creates cached data from the current script instance and returns a Buffer containing the cached bytecode. Return Value Returns a Buffer object containing the cached bytecode that can be used with the cachedData option when creating new script instances. Example 1: Basic Cached Data Creation ...
Read MoreStream writable.cork() and uncork() Method in Node.js
The writable.cork() method is used for forcing all written data to be buffered in memory. This buffered data will only be flushed when stream.uncork() or stream.end() methods are called. These methods are useful for optimizing performance by batching multiple write operations. Syntax cork() writable.cork() uncork() writable.uncork() Parameters Both methods take no parameters. The cork() method buffers subsequent write operations, while uncork() flushes the buffered data to the underlying destination. How It Works When cork() is called, all subsequent write operations are buffered in memory instead of being ...
Read MoreStream writable.writableLength Property in Node.js
The writable.writableLength property returns the number of bytes (or objects) in the queue waiting to be written. This property is useful for monitoring buffer status and understanding the backpressure in your writable streams. Syntax writable.writableLength How It Works The property counts data that is: Buffered in the internal queue Waiting to be processed by the _write() method Corked (temporarily held) in memory Data that has already been written or is currently being processed is not counted. Example 1: Basic Usage with Cork Create a file named writableLength.js and run ...
Read MoreStream writable.writableObjectMode Property in Node.js
The writable.writableObjectMode property is used to check whether a writable stream is operating in object mode. It returns true if object mode is enabled, false if disabled, or undefined if not explicitly set. Syntax writable.writableObjectMode Return Value Returns a boolean value or undefined: true - Object mode is enabled false - Object mode is explicitly disabled undefined - Object mode not set (default) Example 1: Stream with Object Mode Enabled // Program to demonstrate writable.writableObjectMode property // Importing the stream module const stream = require('stream'); // Creating a ...
Read MoreList the important core components of React Native
React Native provides core components that map to native platform views. These components are essential building blocks for creating cross-platform mobile applications. Core Components Overview React Native Component Android Native View iOS Native View Web Browser Description ...
Read MoreWhat are props in react native?
Props are properties that help to modify the React Native component. The component created can be used with different parameters using props concept. With props you can pass information from one component to another and at the same time re-use the component as per your requirement. You will be familiar with props if you are well versed with ReactJS, as the same concepts follow in React Native. Props are read-only and help make components dynamic and reusable. Example 1: Props inside React Native Built-in Components Consider the Image component: The style and ...
Read MoreHow to add styling or css to your app using reactnative?
React Native provides two main approaches for styling your components: using the StyleSheet component and inline styles. Both methods allow you to apply CSS-like properties to create visually appealing mobile applications. Using StyleSheet Component The StyleSheet component is the recommended approach for styling in React Native. It provides better performance and code organization compared to inline styles. Import StyleSheet First, import the StyleSheet component from React Native: import { StyleSheet } from 'react-native'; Creating Styles Create your styles using StyleSheet.create() method: const styles = StyleSheet.create({ container: { ...
Read MoreWhat is the FlatList component and how to use it in React Native?
FlatList is a high-performance, scrollable list component in React Native that efficiently renders large datasets. It offers header and footer support, multiple column support, comes with vertical/horizontal scrolling, lazy loading, and virtualization for optimal performance. Here are some important features of FlatList: Virtualized rendering for performance optimization Scroll loading and lazy rendering ScrollToIndex support for programmatic scrolling Header and footer component support Multiple column support Cross-platform compatibility Configurable viewability ...
Read MoreWhat is the SectionList component and how to use it in React Native?
The SectionList component in React Native provides an efficient way to display data organized in sections with headers. It's perfect for categorized lists like contacts, settings, or grouped items. Key Features Header/Footer support for the entire list Header/Footer support for individual sections Scroll loading and pull-to-refresh functionality Cross-platform compatibility Sticky section headers Basic Syntax import { SectionList } from "react-native"; Important Props ...
Read MoreList some benefits of using React Native for building mobile apps?
React Native has revolutionized mobile app development by enabling cross-platform applications with a single codebase. As iOS and Android apps gain popularity, companies seek faster, cost-effective development solutions. React Native addresses this need by allowing developers to build native mobile apps using JavaScript and React principles. Originally developed by Facebook as a hackathon project, React Native emerged from the need for a unified framework that could serve both iOS and Android platforms with a single development team. Built on the ReactJS JavaScript library, it provides a robust foundation for creating mobile user interfaces while maintaining native performance. Let ...
Read More