Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Entwicklung
  4. [gelöst] Ein Verzeichnis rekursiv durchsuchen.

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    770

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.2k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

[gelöst] Ein Verzeichnis rekursiv durchsuchen.

Scheduled Pinned Locked Moved Entwicklung
verzeichnisdateisuchennode.jsrekursiv
6 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • juliosJ Offline
    juliosJ Offline
    julios
    wrote on last edited by julios
    #1

    Hallo!
    Ich möchte über node.js eine Datei in einem Verzeichnis suchen z.B. nach einem mp3 file, ähnlich wie die Suche in Windows. Als Ergebnis sollen der Pfad und der Dateiname zurückgegeben werden. Evt. auch auswählbar ob nach dem ersten Ergebnis abgebrochen wird oder weitere Ergebnisse gesucht werden sollen. Weis von euch jemand ob es ein npm Modul mit einer Suchfunktion gibt, in 'fs-extra' habe ich nicht das richtige gefunden.
    Besten Dank für eure Unterstützung.

    Gehe gerade mein erstes Projekt an und bin noch sehr unerfahren mit node.js und JavaScript.
    Danke

    1 Reply Last reply
    0
    • dbwebD Offline
      dbwebD Offline
      dbweb
      wrote on last edited by
      #2

      z.B. mit "find"?

      npm install find
      
      juliosJ 2 Replies Last reply
      0
      • dbwebD dbweb

        z.B. mit "find"?

        npm install find
        
        juliosJ Offline
        juliosJ Offline
        julios
        wrote on last edited by
        #3

        @dbweb Danke für die schnelle Unterstützung, genau das habe ich gesucht!
        Wünsch dir einen schönen Tag!

        1 Reply Last reply
        0
        • dbwebD dbweb

          z.B. mit "find"?

          npm install find
          
          juliosJ Offline
          juliosJ Offline
          julios
          wrote on last edited by
          #4

          @dbweb jetzt habe ich noch eine Frage, wie kann ich anstatt dem Ausdruck '/.js$/' eine Variable angeben.

          Danke bg

          find.file(/.js$/, __dirname, function(files) {
          console.log(files.length);
          })

          1 Reply Last reply
          0
          • dbwebD Offline
            dbwebD Offline
            dbweb
            wrote on last edited by
            #5

            Einfach die Variable verwenden?

            let variable = /.mp3$/;
            find.file(variable, __dirname, function(files) {
               console.log(files.length);
            })
            

            Oder was du vermutlich suchst:

            let searchExt = 'mp3';
            let regex = new RegExp("\." + searchExt + "$");
            find.file(regex,__dirname,function(found){
                console.log(found.length);
            })
            

            Evtl. solltest du erstmal ein paar js-Basic Tutorials machen ;)

            juliosJ 1 Reply Last reply
            0
            • dbwebD dbweb

              Einfach die Variable verwenden?

              let variable = /.mp3$/;
              find.file(variable, __dirname, function(files) {
                 console.log(files.length);
              })
              

              Oder was du vermutlich suchst:

              let searchExt = 'mp3';
              let regex = new RegExp("\." + searchExt + "$");
              find.file(regex,__dirname,function(found){
                  console.log(found.length);
              })
              

              Evtl. solltest du erstmal ein paar js-Basic Tutorials machen ;)

              juliosJ Offline
              juliosJ Offline
              julios
              wrote on last edited by
              #6

              @dbweb Nochmals Danke für die Unterstützung!

              Basic-Turtorials, da gebe ich dir volllllkommen recht ;) , hat mich schon gewundert dass du das nicht schon bei deiner ersten Antwort erwähnt hast :) Schau mir als nächstes auf jeden Fall den Umgang mit den Regulären Ausdrücken an!
              Danke noch mal.

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Support us

              ioBroker
              Community Adapters
              Donate

              433

              Online

              32.8k

              Users

              82.7k

              Topics

              1.3m

              Posts
              Community
              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
              ioBroker Community 2014-2025
              logo
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Home
              • Recent
              • Tags
              • Unread 0
              • Categories
              • Unreplied
              • Popular
              • GitHub
              • Docu
              • Hilfe