Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Apr 3, 2023
1 parent 24bc90e commit 2488267
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Overview

![usage](https://user-images.githubusercontent.com/1415488/229589650-c4112b86-f533-4205-a48f-44e88ebbc214.svg)

No need to setup anything, just run the `use-node`, then you can use the right node version under your shell.

- Works the same across Windows, macOS, and Linux.
Expand All @@ -22,6 +24,14 @@ Then it spawns a sub-shell and inject the node path to your PATH, your current s

## Use it outside node project

If you want to use it without the `package.json` file, just specify the node version you want to:

```bash
use-node v19
```

## Shell Setup

On unix like OS, add this line to your `.bashrc` or `.zshrc` files:

```bash
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func main() {
p("Usage: use-node [node-version]")
p("")
p(" If the [node-version] is not specified, it will start a new shell with the version defined in the 'package.json'. If the version doesn't exist, it will be auto downloaded.")
p(" For more doc: https://github.com/ysmood/use-node")
p("")
p("Example:")
p("")
Expand Down
20 changes: 2 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
{
"name": "use-node",
"version": "1.0.0",
"name": "test",
"engines": {
"node": ">=v19.1.0"
},
"description": "No need to setup anything, just run the `use-node`, then you can use the right node version under your shell.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ysmood/use-node.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/ysmood/use-node/issues"
},
"homepage": "https://github.com/ysmood/use-node#readme"
}
}
2 changes: 2 additions & 0 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package node

import (
"log"
"net/http"
"os"
"os/exec"
Expand Down Expand Up @@ -29,6 +30,7 @@ func GetNodePath(required string) string {
os.RemoveAll(nodePath)

fu := fetchup.New(nodePath, n.URLs()...)
fu.Logger = log.New(os.Stdout, "", 0)

utils.E(fu.Fetch())

Expand Down

0 comments on commit 2488267

Please sign in to comment.