If you don’t want to add a new dependency to your project (like glob
), you can use plain js/node functions, like:
var files = fs.readdirSync('C:/tmp').filter(fn => fn.endsWith('.csv'));
Regex
may help in more complex comparisons
More Related Contents:
- Unable to delete data from mongoDB
- node.js require() cache – possible to invalidate?
- module.exports vs. export default in Node.js and ES6
- NPM modules won’t install globally without sudo
- “message failed to fetch from registry” while trying to install any module
- NodeJS – Error installing with NPM
- npm ERR! Error: EPERM: operation not permitted, rename
- What are the differences between node.js and node?
- How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?
- Error installing bcrypt with npm
- Why is node.js only processing six requests at a time?
- npm WARN npm npm does not support Node.js v9.1.0
- bundling precompiled binary into electron app
- mongoose field with the name type
- Simplest way to download and unzip files in Node.js cross-platform?
- Bad state: Insecure HTTP is not allowed by platform: [closed]
- Augmentations for the global scope can only be directly nested in external modules or ambient module declarations(2669)
- Node.js + Joi how to display a custom error messages?
- Meteor Subscribe doesn’t update sort order of collection
- Mongoose optional search query parameters?
- The engine “node” is incompatible with this module
- Message “the term ‘ng’ is not recognized as the name of a cmdlet”
- What is the pwa-node type launch configuration on VSCode?
- Visual Studio Code Debug Console colors?
- Controlling the heartbeat timeout from the client in socket.io
- Node.js promise request return
- How can I output data before I end the response?
- How to send data from JQuery AJAX request to Node.js server
- Uploading multiple files with multer, but from different fields?
- socket.io private message