Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@alwatr/platform-info
Advanced tools
This module provides a way to detect the current platform where the script is running. It defines a constant `platformInfo` which holds the information about the current platform.
This module provides a way to detect the current platform where the script is running. It defines a constant platformInfo
which holds the information about the current platform.
The platformInfo
constant object has the following properties:
name
: The name of the current platform. It can be 'browser', 'node', 'semi-node', or 'unknown'.development
: A boolean indicating whether the NODE_ENV environment variable is not set to production
or in browser location.hostname is localhost
or 127.xxx
.isNode
: A boolean indicating whether the current platform is node.js.isBrowser
: A boolean indicating whether the current platform is a browser.isWebWorker
: A boolean indicating whether the current platform is a web worker.isDeno
: A boolean indicating whether the current platform is Deno.isNw
: A boolean indicating whether the current platform is nw.js.isElectron
: A boolean indicating whether the current platform is Electron.The code also checks whether the script is running in development mode. If the script is running in a browser, it checks if the hostname is 'localhost' or 127.xxx
. If the script is running in a 'semi-node' environment, it checks if the NODE_ENV environment variable is not set to 'production'. The result is stored in the development
property of the platformInfo
object.
yarn add @alwatr/platform-info
import {platformInfo} from '@alwatr/platform-info';
console.log(platformInfo.name); // 'browser' | 'node' | 'semi-node' | 'unknown'
console.log(platformInfo.development); // true | false
console.log(platformInfo.isNode); // true | false
console.log(platformInfo.isBrowser); // true | false
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
This project is licensed under the AGPL-3.0 License.
5.0.0 (2024-11-02)
optional
Co-authored-by: Ali Mihandoost ali@mihandoost.com
get-env-value
package (b2a89e1) by @http-utils
package (8fd5e78) by @resolve-url
package (a884212) by @package-tracer
(f570030) by @definePackage
to use deduplicate
for backward compatibility (990b994) by @@alwatr/util
(4cc22ed) by @weaver
configs(--preset=weaver
) (1bae458) by @__package_name__
(d071d0b) by @global-this
(97aa2d0) by @nanolib
package to export the common packages (1610b1e) by @http-utils
(ab816d2) by @node
packages from their files (e039a2f) by @resolve-url
from nanolib
package (ea40407) by @dedupe
package (10c5ffc) by @get-env-package
(0e9e492) by @@alwatr/math
(f5e32d0) by @render-state
package (7f5b112) by @unicode-digits
package (2ee138e) by @packageTracer
(425e3f9) by @package-tracer
(cc3c5f9) by @import
& use __package_name__
(1ebbe92) by @demo
based on new API (650f159) by @microservice
preset (e5e4826) by @mangleProps
temporary (65d95cc) by @unicode-digits
& update its deps (28a6a65) by @preset
option of nano-build
to module3
(2d49433) by @exports
key for new files (0e9f4aa) by @prototype
to check exactly (15dfb6e) by @README
(ea2513a) by @interface
to type
(c9e6970) by @global-this
package & remove global type (63f5a3b) by @global-this
package & remove global type & prevent sidee-ffects (092d448) by @dedupe
anymore (e6c3ce9) by @global-this
& update exports
key in package.json
(42c8081) by @function
s & improve the code style (207af08) by @global-this
package (42510b9) by @eslint-plugin-require-extensions
to peerDependencies (77d0468) by @include: scope
from commit-message configuration (8786590) by @import
s & test the result of build
(7ba474f) by @FAQs
This module provides a way to detect the current platform where the script is running. It defines a constant `platformInfo` which holds the information about the current platform.
We found that @alwatr/platform-info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.