
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.
@nativescript/brightness
Advanced tools
NativeScript plugin, that helps you set the brightness of the screen for Android and iOS.
ns plugin add @nativescript/brightness
This command automatically installs the necessary files, as well as stores @nativescript/brightness as a dependency in your project's package.json
file.
This plugin requires <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
to be added in the android manifest.
To use the brightness module you must first require()
and instantiate it:
// JavaScript
var nativescriptBrightness = require("@nativescript/brightness");
var brightness = new nativescriptBrightness.Brightness();
Or if you’re using TypeScript, import
the module:
// TypeScript
import { Brightness } from '@nativescript/brightness';
const brightness = new Brightness();
After you have a reference to the module you can then call its get()
and set()
methods. For example, the code below updates you screen's brightness with an intensity
setting of 25%.
The intensity
can be set to a value from 1 to 100.
// TypeScript
import { Brightness } from '@nativescript/brightness';
const brightness = new Brightness();
brightness.set({
intensity: 25
});
Method | Description |
---|---|
set(options: BrightnessOptions) | set screen's brightness to the desired intensity |
get | returns current screen brightness value as a number between 0 and 100 |
getNative | returns current screen brightness value as returned from the native api: between 0.0 and 1.0 for iOS and 0 and 255 for android |
Property | Default | Description |
---|---|---|
intensity | 100 | defines the desired brightness value, which should be a number between 0 and 100. |
Apache License Version 2.0
FAQs
NativeScript plugin, that helps you set the brightness of the screen for Android and iOS.
We found that @nativescript/brightness demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 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.