Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Generate portable common OS paths (home and temp)
npm install os-paths
Requirements
NodeJS >= 6.0
const osPaths = require('os-paths');
osPaths.home();
//(*nix) => '/home/rivy'
//(win) => 'C:\Users\RIvy'
osPaths.temp();
//(*nix) => '/tmp'
//(win) => 'C:\temp'
require('os-paths'): OSPaths()
const osPaths = require('os-paths');
The object returned by the module constructor is an OSPaths
function object, augmented with attached methods. When called directly (eg, const p = osPaths()
), it returns a newly constructed OSPaths
object. Since the OSPaths
object contains no instance state, all constructed objects will be functionally identical.
All module methods return simple, platform-compatible, path strings.
The path strings are not guaranteed to already exist on the file system. So, the user is responsible for directory construction, if/when needed. However, since all of these are standard OS directories, they should all exist without the need for user intervention.
If/when necessary, make-dir
or mkdirp
can be used to create the directories.
osPaths.home(): string
Returns the home directory for user
osPaths.temp(): string
Returns the directory for temporary files
All XDG-related methods have been relocated to the xdg-portable
and xdg-app-paths
modules.
xdg-app-paths
... easy XDG for applicationsxdg-portable
... XDG Base Directory paths (cross-platform)MIT © Roy Ivy III, Sindre Sorhus
FAQs
Determine common OS/platform paths (home, temp, ...)
The npm package os-paths receives a total of 606,087 weekly downloads. As such, os-paths popularity was classified as popular.
We found that os-paths demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.