+1
-1
| { | ||
| "name": "mathmini", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Sample math library containing add and sub functions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+13
-0
| # mathmini-npm | ||
| Sample math library containing add and sub functions | ||
| # Installation | ||
| ```bash | ||
| npm install mathmini | ||
| ``` | ||
| # Usage | ||
| ```js | ||
| var mathmini = require('mathmini'); | ||
| console.log(mathmini.add(10, 5)); | ||
| console.log(mathmini.sub(10, 5)); | ||
| ``` | ||
| # Release and Publish | ||
@@ -5,0 +18,0 @@ 1. Update `version` in `package.json` |
+1
-1
| const { expect } = require('chai'); | ||
| const mathmini = require(".."); | ||
| const mathmini = require('..'); | ||
@@ -4,0 +4,0 @@ describe('Testing add function', () => { |
| name: Publish Package to NPM | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v[0-9]+.[0-9]+.[0-9]+' | ||
| jobs: | ||
| call-workflow: | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: inherit | ||
| build: | ||
| name: Publish Package to NPM | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: '20.x' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - run: npm ci | ||
| - run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| name: Test Package | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_call: | ||
| jobs: | ||
| build: | ||
| name: Test Package | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: npm ci | ||
| - run: npm test |
22
144.44%1489
-28.72%4
-33.33%