Socket
Socket
Sign inDemoInstall

@capacitor/core

Package Overview
Dependencies
1
Maintainers
8
Versions
756
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @capacitor/core

Capacitor: Cross-platform apps with JavaScript and the web


Version published
Weekly downloads
359K
increased by4.09%
Maintainers
8
Install size
467 kB
Created
Weekly downloads
 

Package description

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

Changelog

Source

6.0.0 (2024-04-15)

Bug Fixes

  • cli: Change Capacitor plugin files check (#7375) (fbfb778)
  • cli: Don't downgrade gradle version on migrate (#7385) (c79211e)
  • cli: Removing extra dash in android apk name flavor parsing (#7382) (3c411fd)
  • http: Add URLSearchParams support (#7374) (9367ecc)
  • http: prevent POST request from being proxied (#7395) (7b8c352)
  • secure cookies often are not set by the cookie plugin (#7261) (cda1886)

Features

Readme

Source

Capacitor Core JS

See the Capacitor website for more information.

FAQs

Last updated on 15 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc