diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a87f65a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Tests +on: + - push + - pull_request +jobs: + test: + name: Node.js ${{ matrix.node-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: + - 20 + - 19 + - 18 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test diff --git a/license b/license index 233142c..a1d0e95 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Rocktim Saikia (https://rocktim.xyz) 2020 +Copyright (c) 2024 Rocktim Saikia (https://github.com/sponsors/rocktimsaikia/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/readme.md b/readme.md index 80e8e4e..70ae0d8 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,14 @@ # read-git-user -Returns the GitHub username and email from the current local system. +Returns the GitHub username and email of the current system's `.gitconfig`. > [!NOTE] > This method retrieves the original GitHub username since the stored \ > git config name is not reliable. The name can be changed without \ > affecting the original GitHub username. +[![npm](https://img.shields.io/npm/v/read-git-user?color=bright)](https://npmjs.com/package/read-git-user) + ## Install ```bash @@ -26,19 +28,16 @@ console.log(gitUser); ## API -### readGitUser(options?) - -Returns a `Promise` with the parsed JSON. - -#### options - -##### dir +### readGitUser(options) -Type: `string`
-Default: `os.homedir()` +Returns a `Promise` with the retrieved git config data. -The directory of the `.gitconfig` file +#### Options (`object`) : -## License +##### `dir` -MIT © [Rocktim Saikia](https://rocktim.xyz) +> Type: `string`
+> Default: `os.homedir()` +> +> The directory of the `.gitconfig` file. \ +> This option is available in-case the config file is not in the default dir for some systems.