Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get current path nodejs

console.log("Current directory:", __dirname);
//OR
console.log("Current directory:", process.cwd());
//OR
const path = require("path");

const directoryName = path.basename(__dirname);
console.log(directoryName); 
Comment

PREVIOUS NEXT
Code Example
Javascript :: on radio button change jquery 
Javascript :: vertical align center react native view 
Javascript :: javascript remove leading zeros from string 
Javascript :: 1 line uuid 
Javascript :: regular expression to remove empty lines after text 
Javascript :: on resize jquery 
Javascript :: emmet not working in react nextjs 
Javascript :: Uncaught TypeError: $(...).select2 is not a function 
Javascript :: javascript remove line breaks from string 
Javascript :: on enter key press react 
Javascript :: jquery trigger change event 
Javascript :: how to check for special characters in javascript 
Javascript :: creat react app 
Javascript :: how to refresh slick after tab function 
Javascript :: javascript get current month start and end date 
Javascript :: check if a date time string is a valid date in js 
Javascript :: check angular version 
Javascript :: cypress backspace 
Javascript :: jquery cdn cloudflare 
Javascript :: javascript convert float to int 
Javascript :: react native scrollview horizontal 
Javascript :: leaflet.js cdn 
Javascript :: hash change listener js 
Javascript :: delete dir nodejs 
Javascript :: node express server static files 
Javascript :: enzyme adapter react 17 
Javascript :: javascript remove non numeric chars from string keep dot 
Javascript :: puppeteer get value of div 
Javascript :: class onclick jqery 
Javascript :: add condition inside a className in reactjs 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =