Coder Social home page Coder Social logo

Replacement for `minimatch` about node HOT 4 CLOSED

sgrishchenko avatar sgrishchenko commented on September 23, 2024
Replacement for `minimatch`

from node.

Comments (4)

sgrishchenko avatar sgrishchenko commented on September 23, 2024 1

Yes, something like this. E.g. in Vitest docs you can see an example of exclude property in config. If I want to implement a similar approach in my CLI utility that is written in Node, I need to filter out file names that provides fs.glob for me. Unfortunately, I don't see any way how I can do this using current Node API.

Also, I am developing Karakum project. It also CLI util, I use it to convert Typescript definitions to Kotlin/JS definitions. And I also have a similar problem: I need to collect some files using globs, but then I need to ignore some of them (also using glob). Now I use glob and minimatch libraries for it. I considered using native Node API, but I realized that I don't have a replacement for minimatch.

BTW, thanks for asking.

from node.

MoLow avatar MoLow commented on September 23, 2024

can you give an example of your use case?
do you mean something along the lines of path.matchesPattern(pattern:string, path:string) => boolean?

from node.

MoLow avatar MoLow commented on September 23, 2024

@RedYetiDev are you interested in picking this up and adding a path.isMatch/path.matchesPattern helper?

from node.

RedYetiDev avatar RedYetiDev commented on September 23, 2024

Sure!

from node.

Related Issues (20)

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.