@wrote/exists
Check If The File Or Directory Exists, And Return Stats.
Last updated 6 years ago by zvr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @wrote/exists 
SYNC missed versions from official npm registry.

@wrote/exists

npm version

@wrote/exists Checks If The File Or Directory Exists, And Return Stats.

yarn add -E @wrote/exists

Table Of Contents

API

The package is available by importing its default function:

import exists from '@wrote/exists'

async exists(
  path: string,
): boolean

Returns whether the path exists or not. If it exists, returns the lstat result, otherwise returns null.

/* yarn example/ */
import exists from '@wrote/exists'

(async () => {
  const res = await exists('example')
  const isDir = res.isDirectory()
  console.log(
    'example exists: %s, is dir: %s', !!res, isDir,
  )
  const res2 = await exists('hello')
  console.log('hello exists: %s', res2)
})()
example exists: true, is dir: true
hello exists: null

Copyright

Art Deco © Art Deco for Wrote 2019 Wrote Tech Nation Visa Tech Nation Visa Sucks

Current Tags

  • 1.0.5                                ...           latest (6 years ago)

6 Versions

  • 1.0.5                                ...           6 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 6
Last Month 0
Dependencies (1)
Dev Dependencies (5)

Copyright 2013 - present © cnpmjs.org | Home |