New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

expo-modules-core

Package Overview
Dependencies
Maintainers
0
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-modules-core

The core of Expo Modules architecture

2.2.3
latest
Source
npm
Version published
Weekly downloads
1.1M
0.89%
Maintainers
0
Weekly downloads
 
Created

What is expo-modules-core?

The expo-modules-core package is a core library for Expo modules, providing essential utilities and base classes for building and integrating native modules in Expo and React Native applications. It helps in creating consistent and efficient modules that can be used across different platforms.

What are expo-modules-core's main functionalities?

Module Registry

The Module Registry feature allows you to access native modules registered in the Expo environment. This example demonstrates how to import and use a native module called 'MyModule' to perform an action.

import { NativeModulesProxy } from 'expo-modules-core';

const { MyModule } = NativeModulesProxy;

MyModule.doSomething();

Event Emitters

Event Emitters in expo-modules-core enable you to listen to and handle events emitted by native modules. This example shows how to create an event emitter for a module and add a listener for a specific event.

import { EventEmitter } from 'expo-modules-core';

const emitter = new EventEmitter(MyModule);

emitter.addListener('eventName', (event) => {
  console.log(event);
});

Platform-specific Code

The Platform module allows you to write platform-specific code by checking the operating system at runtime. This example demonstrates how to log different messages based on whether the app is running on iOS or Android.

import { Platform } from 'expo-modules-core';

if (Platform.OS === 'ios') {
  console.log('Running on iOS');
} else if (Platform.OS === 'android') {
  console.log('Running on Android');
}

Other packages similar to expo-modules-core

Keywords

expo

FAQs

Package last updated on 11 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts