
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@capacitor/cli
Advanced tools
The Capacitor command-line interface (CLI) is a tool for creating and managing Capacitor applications. While it can be installed globally, it's recommended to install it locally in your project and execute through npm
scripts.
Install the CLI locally in your project:
npm install @capacitor/cli --save-dev
While not recommended for project use, you can install the CLI globally:
npm install -g @capacitor/cli
The CLI can be used through the capacitor
or cap
command. When installed locally, use it through your project's npm
scripts or npx
.
Common commands:
cap init
: Initialize a new Capacitor projectcap add
: Add a native platform (ios, android)cap sync
: Sync your web code to your native projectsFor detailed information, consult the Getting Started guide.
If you're contributing to the Capacitor CLI or testing local changes:
Clone and setup:
git clone https://github.com/ionic-team/capacitor.git
cd cli
npm install
Build the CLI:
npm run build
Create a local link:
npm link
Development workflow:
npm run watch
to automatically rebuild on changescapacitor
or cap
commands to test your changesnpm test
to execute the test suiteThe CLI includes VS Code launch configurations for debugging. To debug a CLI command:
You can add more configurations by copying and modifying the existing ones in .vscode/launch.json
.
Contributions are welcome! Please read our Contributing Guide for details.
Apache Cordova is a mobile application development framework that allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development. It provides a set of APIs to access native device functions. Compared to @capacitor/cli, Cordova has been around longer and has a larger plugin ecosystem, but Capacitor offers a more modern development experience and better integration with modern web frameworks.
React Native CLI is a command-line interface for React Native, a framework for building native apps using React. It provides commands to create, build, and run React Native projects. Unlike @capacitor/cli, which focuses on web technologies and cross-platform development, React Native CLI is specifically designed for building native mobile apps with React.
Expo CLI is a command-line tool for Expo, a framework and platform for universal React applications. It provides a set of tools and services to build, deploy, and manage React Native apps. Expo CLI simplifies the development process by providing a managed workflow, but it may have limitations compared to @capacitor/cli in terms of accessing native device features directly.
FAQs
Capacitor: Cross-platform apps with JavaScript and the web
The npm package @capacitor/cli receives a total of 717,573 weekly downloads. As such, @capacitor/cli popularity was classified as popular.
We found that @capacitor/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 17 open source maintainers collaborating on the project.
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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.