
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@wrote/ensure-path
Advanced tools
@wrote/ensure-path
Creates All Directories On The Way To The Path.
yarn add @wrote/ensure-path
The package is available by importing its default and named function:
import ensurePath, { ensurePathSync } from '@wrote/ensure-path'
async ensurePath(
path: string,
): string
Makes sure that the path can be written to by recursively creating all necessary directories. Returns the same path as passed to the function.
import { resolve } from 'path'
import ensurePath from '@wrote/ensure-path'
(async () => {
const path = 'example/path/to/temp/file.data'
await ensurePath(path)
// path/to/temp is created in the cwd
const absolutePath = resolve('example/path/to/temp/file.data')
await ensurePath(absolutePath)
// $(pwd)/path/to/temp/file.data is created
})()
ensurePathSync(
path: string,
): string
Same as ensurePath
, but performed synchronously.
import { resolve } from 'path'
import { ensurePathSync } from '@wrote/ensure-path'
const path = 'example/path/to/temp/file.data'
ensurePathSync(path)
// path/to/temp is created in the cwd
const absolutePath = resolve('example/path/to/temp/file.data')
ensurePathSync(absolutePath)
// $(pwd)/path/to/temp/file.data is created
![]() | © Art Deco for Wrote 2019 |
|
![]() | Tech Nation Visa Sucks |
---|
sync
version of the function.FAQs
Create all directories on the way to the path.
The npm package @wrote/ensure-path receives a total of 83 weekly downloads. As such, @wrote/ensure-path popularity was classified as not popular.
We found that @wrote/ensure-path 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.