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, 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:\Windows\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 which are normalized and have no trailing path separators.
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.
optional
git-changelog
... enables changelog automation
npm install
npm test
> npm run help
...
usage: `npm run TARGET [TARGET..]`
TARGETs:
coverage calculate and display (or send) code coverage [alias: 'cov']
fix fix package issues (automated/non-interactive)
fix:lint fix `ESLint` issues
fix:style fix `Prettier` formatting issues
help display help
lint check for package code 'lint'
lint:lint check for code 'lint' (using `ESLint`)
lint:spell check for spelling errors (using `cSpell`)
lint:style check for format imperfections (using `Prettier`)
lint:types check for type declaration errors (using `tsd`)
test test package
test:code test package code
update:changelog update CHANGELOG (using `git changelog ...`)
Contributions are welcome.
Any pull requests should be based off of the default branch (master
). And, whenever possible, please include tests for any new code, ensuring that local (via npm test
) and remote CI testing passes.
By contributing to the project, you are agreeing to provide your contributions under the same license as the project itself.
xdg-app-paths
... easy XDG for applicationsxdg-portable
... XDG Base Directory paths (cross-platform)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.