is-hidden
Check if `filename` is hidden (starts with a dot)
Last updated 8 years ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-hidden 
SYNC missed versions from official npm registry.

is-hidden

Build Coverage Downloads Size

Tiny package that checks if a basename (.gitignore, example.js) is hidden (starts with a dot).

Contents

What is this?

Tiny package that checks if a basename is hidden.

When should I use this?

Probably not, you can do check this yourself. I was doing this so many times that I made it a package years ago.

Install

This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:

npm install is-hidden

In Deno with esm.sh:

import {isHidden} from 'https://esm.sh/is-hidden@2'

In browsers with esm.sh:

<script type="module">
  import {isHidden} from 'https://esm.sh/is-hidden@2?bundle'
</script>

Use

import {isHidden} from 'is-hidden'

isHidden('.git') // => true
isHidden('readme.md') // => false

API

This package exports the identifier isHidden. There is no default export.

isHidden(basename)

Check if basename is hidden (starts with a dot).

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.

Contribute

Yes please! See How to Contribute to Open Source.

Security

This package is safe.

License

MIT © Titus Wormer

Current Tags

  • 2.0.1                                ...           latest (2 years ago)

8 Versions

  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           6 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)

Copyright 2013 - present © cnpmjs.org | Home |