Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor/core

Package Overview
Dependencies
Maintainers
8
Versions
891
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/core

Capacitor: Cross-platform apps with JavaScript and the web

  • 5.7.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
365K
decreased by-5.95%
Maintainers
8
Weekly downloads
 
Created

What is @capacitor/core?

@capacitor/core is a cross-platform native runtime for building web applications that run natively on iOS, Android, and the web. It provides a consistent API for accessing native device features and allows developers to write their application code once and deploy it across multiple platforms.

What are @capacitor/core's main functionalities?

Accessing Device Information

This feature allows you to access detailed information about the device, such as the operating system, model, and manufacturer.

const { Device } = require('@capacitor/device');

async function getDeviceInfo() {
  const info = await Device.getInfo();
  console.log(info);
}

getDeviceInfo();

Geolocation

This feature allows you to access the device's current location using GPS and other location services.

const { Geolocation } = require('@capacitor/geolocation');

async function getCurrentPosition() {
  const coordinates = await Geolocation.getCurrentPosition();
  console.log('Current position:', coordinates);
}

getCurrentPosition();

Camera

This feature allows you to access the device's camera to take photos or capture video.

const { Camera, CameraResultType } = require('@capacitor/camera');

async function takePicture() {
  const image = await Camera.getPhoto({
    quality: 90,
    allowEditing: false,
    resultType: CameraResultType.Uri
  });
  console.log('Image URI:', image.webPath);
}

takePicture();

Storage

This feature allows you to store and retrieve data locally on the device.

const { Storage } = require('@capacitor/storage');

async function storeData() {
  await Storage.set({ key: 'name', value: 'Capacitor' });
  const { value } = await Storage.get({ key: 'name' });
  console.log('Stored value:', value);
}

storeData();

Other packages similar to @capacitor/core

FAQs

Package last updated on 15 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc