Skip to content

Commit

Permalink
doc: add typescript example
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlimjustin committed Jun 8, 2021
1 parent 08b3c10 commit 2678193
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# is-hidden-file
[![npm version](https://img.shields.io/badge/dynamic/json?color=317EFB&logo=npm&style=for-the-badge&label=Version&query=version&url=https%3A%2F%2Funpkg.com%2Fis-hidden-file%40latest%2Fpackage.json)](https://www.npmjs.com/package/is-hidden-file)
> Check if a file/folder is hidden on all platforms.
</div>

> Check if a file/folder is hidden on all platforms.
- Unix: Check file name starts with `.`.
- Windows: Check if file hidden using native code.

Expand All @@ -14,12 +14,21 @@
- yarn: `yarn add is-hidden-file`

## Usage
#### Node js
```js
const { isHiddenFile } = require("is-hidden-file");

console.log(isHiddenFile(".git")) // true
console.log(isHiddenFile("README.md")) // false
```

#### Node js with typescript
```ts
import { isHiddenFile } from "is-hidden-file";

console.log(isHiddenFile(".git")) // true
console.log(isHiddenFile("README.md")) // false
```

## License
MIT

0 comments on commit 2678193

Please sign in to comment.