Git Product home page Git Product logo

kevinfrei / is-hidden-file Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kimlimjustin/is-hidden-file

0.0 1.0 0.0 4.39 MB

Check if a file/folder is hidden on node js that works on any platform.

Home Page: https://www.npmjs.com/package/@freik/is-hidden-file

License: MIT License

C++ 31.67% CMake 11.46% TypeScript 56.87%
attributes filesystem hidden hidden-files hidden-folder windows

is-hidden-file's Introduction

is-hidden-file

Latest Version on NPM here

Check if a file/folder is hidden on all platforms.

Forked from kimlimjustin/is-hidden-file to use CMake (reliable!) instead of node-gyp (inscrutably broken constantly for me), with other fixes (like an obvious memory leak)

Note This will slow down your yarn install/npm installs, particularly on Windows! The speed hit seems unavoidable. Package managers are terrible at understanding build dependencies, so they'll rebuild this whenever it gets installed, even if nothing changed. And the rebuild invokes some platform specific shim which is kind of slow. Once the shim is done, Linux and MacOS move merrily on their way. Windows, however, invokes the cmake build system, followed by the C++ compiler & linker, all of which is quite slow. The solution to this is to get the NodeJS runtime to add support for this to the path or fs modules... It's gotten bad enough that I'm digging for solutions like including pre-built x86 and AMD64 binaries in the NPM package...

  • On *nix: Check file name starts with ..
  • On Windows: Check if the file is hidden using native code.

Installation

  • npm: npm i is-hidden-file
  • yarn: yarn add is-hidden-file

Usage

It's packaged as both CJS and ESM: Use which module type your ecosystem requires. Typescript types are also included.

Node js with or without typescript

import { isHiddenFile } from 'is-hidden-file';
// Or this for CJS:
// const { isHiddenFile } = require('is-hidden-file');

console.log(isHiddenFile('.git')); // true
console.log(isHiddenFile('README.md')); // false

License

MIT, cuz that's what the original was licensed with.

is-hidden-file's People

Contributors

kevinfrei avatar kimlimjustin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.