Skip to content

Commit 9eb6605

Browse files
committed
Feat: add ESM | modernise the project
1 parent d691473 commit 9eb6605

File tree

16 files changed

+6316
-4613
lines changed

16 files changed

+6316
-4613
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Node.js CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
node: [18.x, 20.x, 22.x]
13+
os: [ubuntu-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js ${{ matrix.node }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node }}
21+
- run: npm install
22+
- run: npm run test
23+
- run: npm run lint
24+
- run: npm run prettier:check
25+
if: matrix.os != 'windows-latest'
26+
- name: Coveralls Parallel
27+
uses: coverallsapp/github-action@master
28+
with:
29+
github-token: ${{ secrets.github_token }}
30+
flag-name: run ${{ join(matrix.*, ' - ') }}
31+
parallel: true
32+
finish:
33+
runs-on: ubuntu-latest
34+
needs: test
35+
steps:
36+
- name: Coveralls
37+
uses: coverallsapp/github-action@master
38+
with:
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
parallel-finished: true

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
node_modules
2-
build.js
3-
.nyc_output
42
npm-debug.log
53
coverage
6-
.DS_Store

.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@ Get synchronously the current branch name
1111
```sh
1212
$ npm i current-git-branch --save
1313
```
14+
1415
or
16+
1517
```sh
1618
$ yarn add current-git-branch
1719
```
1820

1921
## Usage
2022

2123
Returns:
24+
2225
- Boolean `false`: It is not a git repository
2326
- String: The branch name
2427

2528
```js
26-
const branchName = require('current-git-branch');
29+
const branchName = require("current-git-branch");
2730

2831
branchName(); // false or branch name of process.cwd()
29-
branchName({ altPath: 'any/git/repo' }); // false or branch name of the directory 'any/git/repo'
30-
branchName({ altPath: 'any/git/repo', branchOptions: [ "--no-color" ] }); // alternatively, you may pass git-branch command options, either as a string or an array
32+
branchName({ cwd: "any/git/repo" }); // false or branch name of the directory 'any/git/repo'
33+
branchName({ cwd: "any/git/repo", options: ["--no-color"] }); // alternatively, you may pass git-branch command options, either as a string or an array
3134
```
3235

3336
## LICENSE

appveyor.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pluginJs from "@eslint/js";
2+
import eslintConfigPrettier from "eslint-config-prettier";
3+
4+
/** @type {import('eslint').Linter.Config[]} */
5+
export default [pluginJs.configs.recommended, eslintConfigPrettier];

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const isGit: (altPath?: string) => boolean;
2+
export default isGit;

0 commit comments

Comments
 (0)