Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wrote/ensure-path

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wrote/ensure-path

Create all directories on the way to the path.

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
increased by8.57%
Maintainers
1
Weekly downloads
 
Created
Source

@wrote/ensure-path

npm version

@wrote/ensure-path Creates All Directories On The Way To The Path.

yarn add -E @wrote/ensure-path

Table Of Contents

API

The package is available by importing its default function:

import ensurePath 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.

/* yarn example */
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
})()

(c) Wrote 2019

Keywords

FAQs

Package last updated on 02 Apr 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc