Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Export/Create a new homedir API method #10

Closed
fraxken opened this issue Apr 28, 2022 · 1 comment
Closed

Export/Create a new homedir API method #10

fraxken opened this issue Apr 28, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@fraxken
Copy link
Member

fraxken commented Apr 28, 2022

Export (create) a new API method homedir. The goal is to design an API similar to Node.js os.homedir.

When we need to create and manage a "global" configuration on the system we need a dedicated directory for NodeSecure (to store the configuration).

This new method should return the path to a nodesecure directory is the os home directory:

import os from "os";
import path from "path";

// !! This !!
path.join(os.homedir(), "nodesecure")

The new API must be used like this:

import * as rc from "@nodesecure/rc";

rc.homedir();

This new API will be useful in our tools like CLI or CI (for example, look at kHomePath const: NodeSecure/cli#104).

@fraxken fraxken added enhancement New feature or request good first issue Good for newcomers labels Apr 28, 2022
@PierreDemailly
Copy link
Member

I'm on it

PierreDemailly added a commit to PierreDemailly/rc that referenced this issue Jun 19, 2022
PierreDemailly added a commit to PierreDemailly/rc that referenced this issue Jun 19, 2022
PierreDemailly added a commit to PierreDemailly/rc that referenced this issue Jun 19, 2022
fraxken pushed a commit that referenced this issue Jun 19, 2022
* feat: add homeDir() API method (#10)
@fraxken fraxken closed this as completed Jun 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants