Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Feb 27, 2023
1 parent b74de61 commit 6e3e8bf
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change logs

## 2023.02.06 v1.0.0
## 2023.02.27 v1.0.0

1. create project
2. [README.md](./README.md)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ $ yarn add userdir

## Usage

```js
import userdir from 'userdir'

userdir() // /Users/saqqdy
```

## Support & Issues

Please open an issue [here](https://github.com/saqqdy/userdir/issues).
Expand Down
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
index.md - v1.0.0-beta.1 / [Exports](modules.md)
index.md - v1.0.0 / [Exports](modules.md)

<div style="text-align: center;" align="center">

Expand Down Expand Up @@ -37,6 +37,12 @@ $ yarn add userdir

## Usage

```js
import userdir from 'userdir'

userdir() // /Users/saqqdy
```

## Support & Issues

Please open an issue [here](https://github.com/saqqdy/userdir/issues).
Expand Down
16 changes: 12 additions & 4 deletions docs/modules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[index.md - v1.0.0-beta.1](README.md) / Exports
[index.md - v1.0.0](README.md) / Exports

# index.md - v1.0.0-beta.1
# index.md - v1.0.0

## Table of contents

Expand All @@ -15,24 +15,32 @@

**default**(): `string` \| `null`

Get the user home directory

#### Returns

`string` \| `null`

- home directory

#### Defined in

[index.ts:3](https://github.com/saqqdy/userdir/blob/58b65c2/src/index.ts#L3)
[index.ts:8](https://github.com/saqqdy/userdir/blob/b74de61/src/index.ts#L8)

---

### userdir

**userdir**(): `string` \| `null`

Get the user home directory

#### Returns

`string` \| `null`

- home directory

#### Defined in

[index.ts:3](https://github.com/saqqdy/userdir/blob/58b65c2/src/index.ts#L3)
[index.ts:8](https://github.com/saqqdy/userdir/blob/b74de61/src/index.ts#L8)
50 changes: 44 additions & 6 deletions docs/out.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": 0,
"name": "index.md - v1.0.0-beta.1",
"name": "index.md - v1.0.0",
"kind": 1,
"kindString": "Project",
"flags": {},
Expand All @@ -15,9 +15,9 @@
"sources": [
{
"fileName": "index.ts",
"line": 22,
"line": 27,
"character": 0,
"url": "https://github.com/saqqdy/userdir/blob/58b65c2/src/index.ts#L22"
"url": "https://github.com/saqqdy/userdir/blob/b74de61/src/index.ts#L27"
}
],
"signatures": [
Expand All @@ -27,6 +27,25 @@
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Get the user home directory"
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "- home directory"
}
]
}
]
},
"type": {
"type": "union",
"types": [
Expand All @@ -52,9 +71,9 @@
"sources": [
{
"fileName": "index.ts",
"line": 3,
"line": 8,
"character": 16,
"url": "https://github.com/saqqdy/userdir/blob/58b65c2/src/index.ts#L3"
"url": "https://github.com/saqqdy/userdir/blob/b74de61/src/index.ts#L8"
}
],
"signatures": [
Expand All @@ -64,6 +83,25 @@
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Get the user home directory"
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "- home directory"
}
]
}
]
},
"type": {
"type": "union",
"types": [
Expand Down Expand Up @@ -95,7 +133,7 @@
"fileName": "index.ts",
"line": 1,
"character": 0,
"url": "https://github.com/saqqdy/userdir/blob/58b65c2/src/index.ts#L1"
"url": "https://github.com/saqqdy/userdir/blob/b74de61/src/index.ts#L1"
}
]
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "userdir",
"description": "A simple utility to get the cross-platform user home directory",
"version": "1.0.0-beta.1",
"version": "1.0.0",
"packageManager": "pnpm@7.26.1",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"unpkg": "./dist/index.min.js",
"jsdelivr": "./dist/index.min.js",
"typings": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./*": "./*"
},
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import os from 'os'

/**
* Get the user home directory
*
* @returns - home directory
*/
export function userdir(): string | null {
const env = process.env
const home = env.HOME
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"compilerOptions": {
"allowJs": true,
"strict": true,
"module": "NodeNext",
"module": "EsNext",
"noImplicitAny": true,
"removeComments": true,
"moduleResolution": "NodeNext",
"moduleResolution": "Node",
"noImplicitOverride": true,
"noUnusedLocals": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 6e3e8bf

Please sign in to comment.