Node 14 relative include

Questions : Node 14 relative include

842

In a Node 12 .js file, I previously used programming this approach to successfully load a Learning configuration file:

const config = _OFFSET);  require("./config.json");

When changing to Node 14 with a .mjs Earhost file I adopted this:

const config = (-SMALL  JSON.parse(fs.readFileSync("./config.json"));

I have called both using this command most effective (in a cronjob):

/opt/homebrew/bin/node _left).offset  ~me/Developer/su-squares/update-script/have-there-been-updates.mjs arrowImgView.mas  || say updates

And the behavior is different. The wrong idea former loads the config file relative to use of case the calling .js file. But the latter United loads relative to the current working Modern directory.

Is it possible to update the latter to ecudated adopt the preferred relative file path some how search?

Total Answers 0

Top rated topics

JQuery button click auto click next button

Teams 'navigator.permissions' is 'undefined' in Tabs/Task on Mobile devices

In Power BI, How can I plot a yeartarget (one number in a table) in fixed fractions over twelve months?

How to create custom shapes in Jetpack Compose?

Pandas: how to group by time intervals of varying length?

Unclear type inference for mapped types with generics

Upper limit on number of redis streams consumer groups?

Removing an item and printing the list in one line

My Unity Editor is Crashing due to a Native UI error very often, how do I fix it?

SQL Historian Query not returning all results

How set resizer icon on top?

Sniffing packets on loopback with scapy

Customize select output from a postgress query

Secret creation with SecretProviderClass not working as aspected

Using dynamic values for Kubernetes namespace labels

How to write Dynamic Pages for complex Urls in Nuxt js?

How to control output of a nuget package dependencies during build

Supertype from interface no generated in QClass

Array updating problem for using map(int,input().split()) in python

How to switch from database in postgres with psql?

Discord.js cannot add option to slash commands

Setting different delay for loading indicator vaadin 8

How to obtain keys from Google Console

Yield return saves the next state of iterator

Placing two SkiaLayer side by side with skiko and swing

How to add text array in PptxGenJS masterslide

NodeJS + Keycloak without express

How to include dependency repos on published android library

Return three largest values from distribution in one formula

An error when running detectron2 demo , a mp4 video as input

Get Outlook AppointmentItem using GlobalAppointmentID

Bucket policy with Minio

Time Difference with Binance Server

Eslint + typescript paths aliasing - Unable to resolve path to module

How do you import a Razor page from a RCL you got from a NuGet package?

Enforce printable characters only in text fields

Pandas TypeError bad operand type for unary ~: 'list', Python 3.10.1

Split object into two and renumerate keys

How can I check if image is publish on Azure Blob Storage?

How would you add a time offset using the same name as the class name for the parameter

Center <p> in <div> with left alignment?

Align child element's center by the paren'ts container right edge

Extract FB eventID from already fired event

Some column Missing Bottom border in material UI

Src-resolve: Cannot resolve the name 'name2:Demo3' to a(n) 'element declaration' component

How to run SSIS packages to multiple servers based on environment variables?

Trying to Smoothly animate in console in c++

Get data from an api and store it in a state, but the state still shows undefined

Is there any way to run python script from Azure File Shares using Batch Service activity in Azure Data Factory?

Simple Peg Solitaire Game(Logical errors prevent it from being playable)

Top