Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Bill Kervaski's user avatar
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 ...
nopassport1's user avatar
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 ...
Vhin Gabuat's user avatar
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 ...
askhat's user avatar
  • 123
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 ...
Un1's user avatar
  • 123
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 ...
Matěj Pokorný's user avatar
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 ...
kemotoe's user avatar
  • 233
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,...
PRAISER's user avatar
  • 151
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: ...
user avatar
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 ...
Miha Šušteršič's user avatar
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, ...
1252748's user avatar
  • 177
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 ...
Pompey Magnus's user avatar
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? ...
ThomasReggi's user avatar
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 ...
rolfl's user avatar
  • 98.1k
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 ...
rolfl's user avatar
  • 98.1k

15 30 50 per page