@avinashtare/env_path

1.0.1 • Public • Published

Env_Path

A Node.js module for managing the only windows system environment variable PATH. The env_path middleware is a powerful tool designed to streamline the management of the Windows system environment path. It empowers users to easily control, modify, and enhance their environment variables, providing a seamless experience for developers and system administrators.

Install

npm install @avinashtare/env_path

warning

  • This Package Only Work On Windows System.
  • You Also Run Your Code On Administration

how to get All Env Variables

import env_path from "@avinashtare/env_path";

console.log(env_path.getAll())

Add Path Environment Variables

import env_path from "@avinashtare/env_path";

async function addPath(newPath){
    let isUpdated = await env_path.addPath(newPath)
    if(isUpdated){
        console.log("Your Path Hass Been Added")
    }
    else{
        console.log("Fail To Update Path")
    }
}
let addNewPath = "E:\\Users\\Public\\Music";
addPath(addNewPath);

Replace Path Environment Variables

// replace path 
async function replacePath(oldPath,newPath){
    let isUpdated = await env_path.replacePath(oldPath,newPath)
    if(isUpdated){
        console.log("You Path hass been replaced")
    }
    else{
        console.log("Fail To replaced Path")
    }
}
let addOldPath = "E:\\Users\\Public\\Music";
let addNewPaths = "E:\\Users\\Public\\New";
replacePath(addOldPath,addNewPaths);

Remove Path Environment Variables

// replace path 
// remove path 
async function removePath(removePath){
    let isUpdated = await env_path.removePath(removePath)
    if(isUpdated){
        console.log("Your Path removed")
    }
    else{
        console.log("Fail To removed Path")
    }
}
let removeOldPath = "E:\\Users\\Public\\Music";

License

License This project is released under the MIT License.

Contact

avinashtare.work@gmail.com

Author

卐🕉 Avinash Tare 🕉 卐

Package Sidebar

Install

npm i @avinashtare/env_path

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.14 kB

Total Files

6

Last publish

Collaborators

  • avinashtare