Skip to content

Commit

Permalink
Initial module setup
Browse files Browse the repository at this point in the history
  • Loading branch information
elvisvoer committed Jan 19, 2024
0 parents commit ea3654d
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Elvis Adomnica

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# b-path

A platform agnostic implementation of the `node:path` module.
3 changes: 3 additions & 0 deletions lib/b-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import path from "node:path";

export default path;
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "b-path",
"version": "0.0.0",
"description": "Platform agnostic PATH module implementation",
"author": {
"name": "Elvis Adomnica",
"url": "https://erranto.com"
},
"repository": {
"type": "git",
"url": "git://github.com/elvisvoer/b-path.git"
},
"scripts": {
"test": "node --test tests"
},
"license": "MIT",
"type": "module",
"private": false,
"module": "./lib/b-path.js",
"exports": {
".": {
"import": "./lib/b-path.js"
}
}
}
18 changes: 18 additions & 0 deletions tests/b-path.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';

describe("A thing", () => {
it("should work", () => {
assert.strictEqual(1, 1);
});

it("should be ok", () => {
assert.strictEqual(2, 2);
});

describe("a nested thing", () => {
it("should work", () => {
assert.strictEqual(3, 3);
});
});
});

0 comments on commit ea3654d

Please sign in to comment.