Skip to content

Commit 54a04e8

Browse files
committed
Feat: add ESM | modernise the project
1 parent d691473 commit 54a04e8

17 files changed

+6350
-4647
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.

CHANGELOG.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
1.1.0 - October, 16 2018
22

3-
* 164bdb9 Chore: drop support for Node v4 (#2) (Jan Peer Stöcklmair)
4-
* 7d6bddc Ability to pass options to `git-branch` command (#1) (Ryan Stimmler)
5-
* 5a2b4ea 1.0.1 (JPeer264)
6-
* fee095b Test: update fixtures (JPeer264)
7-
* 190593d 1.0.1 (JPeer264)
8-
* f4aba3c Feat: add test folder (JPeer264)
9-
* b014237 Feat: remove test folder (JPeer264)
3+
- 164bdb9 Chore: drop support for Node v4 (#2) (Jan Peer Stöcklmair)
4+
- 7d6bddc Ability to pass options to `git-branch` command (#1) (Ryan Stimmler)
5+
- 5a2b4ea 1.0.1 (JPeer264)
6+
- fee095b Test: update fixtures (JPeer264)
7+
- 190593d 1.0.1 (JPeer264)
8+
- f4aba3c Feat: add test folder (JPeer264)
9+
- b014237 Feat: remove test folder (JPeer264)
1010

11-
1.0.1 - December, 18 2017
11+
1.0.1 - December, 18 2017
1212

13-
* f4aba3c Feat: add test folder (JPeer264)
14-
* b014237 Feat: remove test folder (JPeer264)
15-
* 369da22 CI: add Node v8 testing (JPeer264)
16-
* f930a7e Test: fix tests for CI (JPeer264)
17-
* cc4f997 Chore: update gitignore (JPeer264)
18-
* b2a4d80 Test: fix tests (JPeer264)
19-
* 392accf Style: lint tests (JPeer264)
20-
* c559b53 Fix: add require support (JPeer264)
13+
- f4aba3c Feat: add test folder (JPeer264)
14+
- b014237 Feat: remove test folder (JPeer264)
15+
- 369da22 CI: add Node v8 testing (JPeer264)
16+
- f930a7e Test: fix tests for CI (JPeer264)
17+
- cc4f997 Chore: update gitignore (JPeer264)
18+
- b2a4d80 Test: fix tests (JPeer264)
19+
- 392accf Style: lint tests (JPeer264)
20+
- c559b53 Fix: add require support (JPeer264)
2121

22-
1.0.0 - April, 08 2017
23-
24-
* 0779d69 :wrench: Chore: move is-ci to devdeps (JPeer264)
25-
* ef81597 :memo: Docs: add appveyor badge (JPeer264)
26-
* 6f457f9 :wrench: Chore: remove test.js from the coverage (JPeer264)
27-
* 8328038 :white_check_mark: Test: wrong parentheses on CI tests (JPeer264)
28-
* d985459 :white_check_mark: Test: own tests for CIs (JPeer264)
29-
* 7569b58 :wrench: Chore: add is-ci as CI detach HEADs (JPeer264)
30-
* 769c1c9 :white_check_mark: Test: update tests for CIs (JPeer264)
31-
* 172d2fd :wrench: Chore: update npm to latest (JPeer264)
32-
* 08dd97c :wrench: Chore: add npm/node version to travis for debugging (JPeer264)
22+
1.0.0 - April, 08 2017
3323

24+
- 0779d69 :wrench: Chore: move is-ci to devdeps (JPeer264)
25+
- ef81597 :memo: Docs: add appveyor badge (JPeer264)
26+
- 6f457f9 :wrench: Chore: remove test.js from the coverage (JPeer264)
27+
- 8328038 :white_check_mark: Test: wrong parentheses on CI tests (JPeer264)
28+
- d985459 :white_check_mark: Test: own tests for CIs (JPeer264)
29+
- 7569b58 :wrench: Chore: add is-ci as CI detach HEADs (JPeer264)
30+
- 769c1c9 :white_check_mark: Test: update tests for CIs (JPeer264)
31+
- 172d2fd :wrench: Chore: update npm to latest (JPeer264)
32+
- 08dd97c :wrench: Chore: add npm/node version to travis for debugging (JPeer264)

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# current-git-branch
22

3-
[![Build Status](https://travis-ci.org/JPeer264/node-current-git-branch.svg?branch=master)](https://travis-ci.org/JPeer264/node-current-git-branch)
4-
[![Build status](https://ci.appveyor.com/api/projects/status/ehj6762gbj1e2qyc?svg=true)](https://ci.appveyor.com/project/JPeer264/node-current-git-branch)
3+
[![Build Status](https://img.shields.io/github/actions/workflow/status/JPeer264/node-current-git-branch/ci.yml?branch=main)](https://github.com/JPeer264/node-current-git-branch/actions/workflows/ci.yml?query=branch%3Amain)
54
[![Coverage Status](https://coveralls.io/repos/github/JPeer264/node-current-git-branch/badge.svg?branch=master)](https://coveralls.io/github/JPeer264/node-current-git-branch?branch=master)
65

76
Get synchronously the current branch name
@@ -11,23 +10,20 @@ Get synchronously the current branch name
1110
```sh
1211
$ npm i current-git-branch --save
1312
```
14-
or
15-
```sh
16-
$ yarn add current-git-branch
17-
```
1813

1914
## Usage
2015

2116
Returns:
17+
2218
- Boolean `false`: It is not a git repository
2319
- String: The branch name
2420

2521
```js
26-
const branchName = require('current-git-branch');
22+
import branchName from "current-git-branch";
2723

2824
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
25+
branchName({ cwd: "any/git/repo" }); // false or branch name of the directory 'any/git/repo'
26+
branchName({ cwd: "any/git/repo", options: ["--no-color"] }); // alternatively, you may pass git-branch command options, either as a string or an array
3127
```
3228

3329
## 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];

0 commit comments

Comments
 (0)