diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e964e1..1ccaa4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
diff --git a/README.md b/README.md
index 09720cf..274afb2 100644
--- a/README.md
+++ b/README.md
@@ -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).
diff --git a/docs/README.md b/docs/README.md
index ac07f22..173bd7f 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,4 +1,4 @@
-index.md - v1.0.0-beta.1 / [Exports](modules.md)
+index.md - v1.0.0 / [Exports](modules.md)
@@ -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).
diff --git a/docs/modules.md b/docs/modules.md
index 54d3b34..a78af26 100644
--- a/docs/modules.md
+++ b/docs/modules.md
@@ -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
@@ -15,13 +15,17 @@
▸ **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)
---
@@ -29,10 +33,14 @@
▸ **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)
diff --git a/docs/out.json b/docs/out.json
index 9c0ee57..de0fa1c 100644
--- a/docs/out.json
+++ b/docs/out.json
@@ -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": {},
@@ -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": [
@@ -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": [
@@ -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": [
@@ -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": [
@@ -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"
}
]
}
\ No newline at end of file
diff --git a/package.json b/package.json
index ebed7c2..d754a63 100644
--- a/package.json
+++ b/package.json
@@ -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"
},
"./*": "./*"
},
diff --git a/src/index.ts b/src/index.ts
index 17e57e6..5ee4f49 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -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
diff --git a/tsconfig.json b/tsconfig.json
index 9127294..966ca81 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -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,