All Questions
Tagged with file-system node.js
17 questions
2
votes
1
answer
129
views
Safely renaming/moving files in Node (cross platform)
My goal is to create a function that safely renames files by adding numeric increments if the file is found at the destination, without using a third party library.
Having a source file ...
3
votes
1
answer
224
views
NodeJS CLI script to create React apps
Background
I crated a CLI tool which executes an npm command (to create a react app) and modifies the contents of the generated files. It was a practice attempt at ...
4
votes
2
answers
202
views
Reading image files asynchronously and displaying them on the page
I am trying to display images from a folder in my project using the "fs" module with NodeJS. I need to read all images in a directory and run them in a loop for them to be displayed. I was able to do ...
0
votes
1
answer
373
views
Git hook written on JavaScript
As in many teams, me and my coworkers are putting ticket number into beginning of each commit message. If your branches are starting with ticket number it is easy to create ...
2
votes
1
answer
255
views
Scanning directories and caching paths to an array
What am I trying to do
I'm trying to scan a disk and save (cache) all the paths of files and directories into an array so that I could perform a quick file/directory search later on.
Implementation
...
1
vote
2
answers
372
views
Generator function to enumerate files
I want to implement a function that enumerates all files in directory. I think the function should
Return a Promise, because underlying readdir call is prefered ...
0
votes
1
answer
594
views
"Quick" save in electron with a conformation dialog
I have implemented a "quick" save for my electron app. There has to be a better way to achieve what I am doing.
The MessageBox will always be triggered on a save ...
2
votes
1
answer
577
views
Typescript: Recursion file-system lookup
Previously I asked a question to find the best practice of recursively running a function to retrieve all import/export statements of files in NodeJs here.
After some discussion I'm not satisfied yet,...
12
votes
2
answers
4k
views
Generate a nested structure based on a list of file paths
I'm currently working on a small application, as a learning exercise for a Javascript novice. I need to generate an object based on a folder structure. Here is an example of the folder structure:
...
1
vote
1
answer
74
views
nodeJS, fs, path - creating new directorties
I wrote this function that takes 2 arguments - the path to an existing file - file, and the newRoot name. The function splits ...
3
votes
0
answers
573
views
Recursively list files in provided directory in the style of `npm ls`
I've written a small CLI node program to list the contents of a directory with an output similar to that provided by npm ls but listing both files and directories, ...
1
vote
1
answer
814
views
Optionally creating a directory path based based on existence in NodeJS
I've been doing some reading and tutorials. As such I've contrived a node based project to apply what I've learned. I thought this was a good example as it had some conditional async calls and error ...
1
vote
1
answer
480
views
File existence promise
I hate to have to write a custom exists promise every time I need to know if a file exists, so I came up with this. Thoughts?
...
4
votes
1
answer
192
views
Mapping file data to environment variables
This is a follow-on to my previous question: Enforcing set environment variables
While learning more about JavaScript, node, and the bluemix environment, I have been using the loading of process ...
9
votes
2
answers
2k
views
Enforcing set environment variables
Context
I have a node.js application that uses many other modules and libraries. Some of these modules pull details from process environment variables, such as URL's for databases, credentials, and so ...