Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
Update npm-publish.yml

v 1.0.0
  • Loading branch information
Amitind committed Oct 13, 2024
1 parent 064cbf1 commit e00c8f3
Show file tree
Hide file tree
Showing 12 changed files with 1,746 additions and 253 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@
name: Node.js NPM Package

on:
release:
types: [created]
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
# - run: npm ci
# - run: npm test
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run build
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
# - run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-npm:
needs: test-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#play and test npm package

_play

# Logs
logs
*.log
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# util

## JavaScript Functions to save time
## TypeScript-ready JavaScript Functions to save time

Some useful Javascript functions that I use.
Some useful TypeScript/JavaScript functions that I use.

Install

```cmd
npm i @amitind/util
```

Use in Project

```js
import { randomString } from '@amitind/util';
```

or

```js
const { randomNumber } = require('@amitind/util');
```

## Functions

- randomString
- randomNumber
- binary
- shuffleArray
- randomArrayItem
- randomItemsArray
- uniqueArrayitems
186 changes: 0 additions & 186 deletions index.js

This file was deleted.

13 changes: 0 additions & 13 deletions package-lock.json

This file was deleted.

75 changes: 47 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,49 @@
{
"name": "@amitind/util",
"version": "0.1.2",
"description": "Some useful Javascript functions that I use.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Amitind/util.git"
},
"keywords": [
"util",
"javascript",
"js",
"utility"
],
"author": "Amit Yadav",
"license": "MIT",
"bugs": {
"url": "https://github.com/Amitind/util/issues"
},
"homepage": "https://www.npmjs.com/package/@amitind/util",
"files": [
"index.js",
"README.md",
"LICENSE"
]
"name": "@amitind/util",
"version": "1.0.0",
"description": "Some useful Javascript functions that I use.",
"type": "module",
"files": [
"dist"
],
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"dev": "vite",
"dev:build": "rimraf dist && pnpm build --watch",
"build": "tsc && vite build",
"test": "echo \"No tests\"",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Amitind/util.git"
},
"keywords": [
"util",
"javascript",
"js",
"utility"
],
"author": "Amit Yadav",
"license": "MIT",
"bugs": {
"url": "https://github.com/Amitind/util/issues"
},
"homepage": "https://www.npmjs.com/package/@amitind/util",
"devDependencies": {
"path": "^0.12.7",
"rimraf": "^6.0.1",
"typescript": "^5.6.3",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.4"
}
}
Loading

0 comments on commit e00c8f3

Please sign in to comment.