# lstat

> Promise-based `lstat`

Latest version **1.0.0** (published 2017-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install lstat
pnpm add lstat
yarn add lstat
bun add lstat
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-02-27 |
| First published | 2017-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | stat, lstat, file, link, info, mode, nlink, uid, gid, rdev, fs, promise, promisified, async |

## Links

- npm: https://www.npmjs.com/package/lstat
- Repository: https://github.com/shinnn/lstat
- Homepage: https://github.com/shinnn/lstat#readme
- Issues: https://github.com/shinnn/lstat/issues
- npm.io page: https://npm.io/package/lstat

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-02-27
- 0.4.0 — 2017-02-20
- 0.3.0 — 2017-02-13
- 0.2.0 — 2017-02-10
- 0.1.0 — 2017-02-07
- 0.0.0 — 2017-02-07

## README

# lstat

[![NPM version](https://img.shields.io/npm/v/lstat.svg)](https://www.npmjs.com/package/lstat)
[![Build Status](https://travis-ci.org/shinnn/lstat.svg?branch=master)](https://travis-ci.org/shinnn/lstat)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/lstat.svg)](https://coveralls.io/github/shinnn/lstat?branch=master)

[Promise](https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Promise)-based [`lstat`](http://man7.org/linux/man-pages/man2/lstat.2.html)

```javascript
const lstat = require('lstat');

lstat('/path/to/file').then(stat => {
  stat; //=> {dev: 16777220, mode: 33188, nlink: 1, uid: 501, gid: 20, ...}
});
```

## Installation

[Use npm.](https://docs.npmjs.com/cli/install)

```
npm install lstat
```

## API

```javascript
const lstat = require('lstat');
```

### lstat(*path*)

*path*: `String`  
Return: `Promise<fs.Stats>`

Almost the same as the [Node.js](https://nodejs.org/) built-in [`fs.lstat`](https://nodejs.org/api/fs.html#fs_fs_lstat_path_callback), but:

* It returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise), instead of passing the result to its callback function.
* The first parameter does't accept `Buffer` by design. Just use `String` instead.

```javascript
lstat('/path/to/directory').then(stat => {
  stat.isDirectory(); //=> true
});

lstat('/path/to/symlink').then(stat => {
  stat.isSymbolicLink(); //=> true
});
```

## License

Copyright (c) 2017 [Shinnosuke Watanabe](https://github.com/shinnn)

Licensed under [the MIT License](./LICENSE).

---
_Source: https://npm.io/package/lstat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
