Skip to content

Commit e9f65d7

Browse files
committed
Cosmetic changes
1 parent 00a1b3e commit e9f65d7

File tree

4 files changed

+118
-67
lines changed

4 files changed

+118
-67
lines changed

.github/.DS_Store

6 KB
Binary file not shown.

.github/workflows/release.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Release
22
on:
33
workflow_dispatch: # Manual trigger alone
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags
47

58
jobs:
69
release:
@@ -15,12 +18,34 @@ jobs:
1518
with:
1619
node-version: "18.x"
1720
registry-url: "https://registry.npmjs.org/"
21+
scope: "@rahu619" # Replace with your actual organization name
1822

19-
- name: Publish to npmjs
20-
run: npm publish
21-
env:
22-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
- name: Debug npm auth
24+
run: |
25+
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
26+
npm whoami
27+
28+
- name: Install Dependencies
29+
run: npm ci
30+
31+
- name: Run Tests
32+
run: npm test
33+
34+
- name: Build
35+
run: npm run build
2336

24-
- name: Get npm Package node-version
37+
- name: Get npm Package Version
2538
id: package-version
2639
uses: martinbeentjes/npm-get-version-action@v1.3.1
40+
41+
- name: Validate Version
42+
run: |
43+
if [[ ! ${{ steps.package-version.outputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
44+
echo "Invalid version format"
45+
exit 1
46+
fi
47+
48+
- name: Publish to npmjs
49+
run: npm publish --access public
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 82 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,123 @@
11
# cron-converter-u2q
22

3-
![Github Repo Stars](https://img.shields.io/github/stars/rahu619/cron-converter-u2q?style=social)
3+
[![Github Repo Stars](https://img.shields.io/github/stars/rahu619/cron-converter-u2q?style=social)](https://github.com/rahu619/cron-converter-u2q)
44
[![NPM version](https://img.shields.io/npm/v/cron-converter-u2q)](https://www.npmjs.com/package/cron-converter-u2q)
5-
![GitHub License](https://img.shields.io/github/license/rahu619/cron-converter-u2q?style=plastic)
6-
![GitHub Build](https://github.com/rahu619/cron-converter-u2q/actions/workflows/integration.yml/badge.svg?branch=main)
7-
![Github Release](https://github.com/rahu619/cron-converter-u2q/actions/workflows/release.yml/badge.svg?event=workflow_dispatch)
8-
![Github Top Language](https://img.shields.io/github/languages/top/rahu619/cron-converter-u2q?style=plastic)
5+
[![GitHub License](https://img.shields.io/github/license/rahu619/cron-converter-u2q?style=plastic)](LICENSE)
6+
[![GitHub Build](https://github.com/rahu619/cron-converter-u2q/actions/workflows/integration.yml/badge.svg?branch=main)](https://github.com/rahu619/cron-converter-u2q/actions)
7+
[![Github Release](https://github.com/rahu619/cron-converter-u2q/actions/workflows/release.yml/badge.svg?event=workflow_dispatch)](https://github.com/rahu619/cron-converter-u2q/actions)
8+
[![Github Top Language](https://img.shields.io/github/languages/top/rahu619/cron-converter-u2q?style=plastic)](https://www.typescriptlang.org/)
9+
[![npm downloads](https://img.shields.io/npm/dm/cron-converter-u2q)](https://www.npmjs.com/package/cron-converter-u2q)
910

1011
[![https://nodei.co/npm/cron-converter-u2q.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/cron-converter-u2q.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/cron-converter-u2q)
1112

12-
Easily work with cron expressions using the `cron-converter-u2q` package. Effortlessly convert between Unix and Quartz formats and describe cron schedules in plain language.
13+
A powerful TypeScript library for working with cron expressions. Effortlessly convert between Unix and Quartz formats, generate human-readable descriptions, and validate cron expressions with ease.
1314

14-
### Features
15+
## Features
1516

16-
:arrows_counterclockwise: **Two-way conversion**
17+
### 🔄 Two-way Conversion
18+
- **Unix to Quartz**: Convert standard Unix cron expressions to Quartz format
19+
- **Quartz to Unix**: Convert Quartz cron expressions to standard Unix format
20+
- **Format Validation**: Built-in validation for both formats
21+
- **Error Handling**: Clear error messages for invalid expressions
1722

18-
Effortlessly convert cron expressions:
19-
- From Unix to Quartz
20-
- From Quartz to Unix
23+
### 📝 Human-readable Descriptions
24+
- **Natural Language**: Convert cron expressions to plain English
25+
- **Multiple Languages**: Support for different language descriptions
26+
- **Customizable**: Extend with your own description templates
27+
- **Detailed**: Includes all schedule details (minutes, hours, days, etc.)
2128

22-
:memo: **Human-readable Descriptions**
29+
### 🛠️ Developer Friendly
30+
- **TypeScript Support**: Full type definitions included
31+
- **Zero Dependencies**: Lightweight and fast
32+
- **Well Tested**: Comprehensive test coverage
33+
- **ES6 Modules**: Support for both CommonJS and ES6 imports
2334

24-
Translate cron schedules into plain, understandable text:
25-
- Example: `*/5 * * * *` -> "Every 5 minutes"
35+
### 🔍 Validation & Error Handling
36+
- **Format Validation**: Ensures cron expressions are valid
37+
- **Range Checking**: Validates field values within acceptable ranges
38+
- **Clear Errors**: Descriptive error messages for debugging
39+
- **Type Safety**: TypeScript types for better development experience
2640

27-
### Installation
28-
29-
Using npm:
41+
## 📦 Installation
3042

3143
```bash
44+
# Using npm
3245
npm install cron-converter-u2q
33-
```
3446

35-
Using yarn:
36-
37-
```bash
47+
# Using yarn
3848
yarn add cron-converter-u2q
39-
```
4049

41-
### Usage
50+
# Using pnpm
51+
pnpm add cron-converter-u2q
52+
```
4253

43-
Firstly, import the CronConverterU2Q module:
54+
## 🚀 Quick Start
4455

45-
```javascript
46-
var cron_converter_u2q = require("cron-converter-u2q");
56+
```typescript
57+
import { CronConverterU2Q } from 'cron-converter-u2q';
4758

48-
var c2q = cron_converter_u2q.CronConverterU2Q;
49-
```
59+
// Convert Unix to Quartz
60+
const quartzExpression = CronConverterU2Q.unixToQuartz('5 * * * *');
61+
console.log(quartzExpression); // "0 5 * * * ? *"
5062

51-
If you're using ES6 Modules
63+
// Convert Quartz to Unix
64+
const unixExpression = CronConverterU2Q.quartzToUnix('0 0 8 * * ?');
65+
console.log(unixExpression); // "0 8 * * *"
5266

53-
```javascript
54-
import { CronConverterU2QModule as c2q } from "cron-converter-u2q";
67+
// Get human-readable description
68+
const description = CronConverterU2Q.describeUnix('*/5 * * * *');
69+
console.log(description); // "Every 5 minutes"
5570
```
5671

57-
### Conversion Methods
72+
## 📚 Examples
5873

59-
#### Convert from Unix to Quartz:
74+
### Basic Conversions
6075

61-
```javascript
62-
const quartzExpression = c2q.unixToQuartz("5 * * * *");
63-
```
64-
65-
#### Convert from Quartz to Unix:
76+
```typescript
77+
// Unix to Quartz
78+
CronConverterU2Q.unixToQuartz('0 12 * * *'); // "0 0 12 * * ? *"
79+
CronConverterU2Q.unixToQuartz('*/15 * * * *'); // "0 */15 * * * ? *"
6680

67-
```javascript
68-
const unixExpression = c2q.quartzToUnix("* */5 * ? * * *");
81+
// Quartz to Unix
82+
CronConverterU2Q.quartzToUnix('0 0 8 * * ?'); // "0 8 * * *"
83+
CronConverterU2Q.quartzToUnix('0 */5 * * * ?'); // "*/5 * * * *"
6984
```
7085

71-
### Description Methods
72-
73-
You can now generate human-readable descriptions for Unix and Quartz cron expressions.
86+
### Human-readable Descriptions
7487

75-
#### Describe Unix Cron Expressions:
88+
```typescript
89+
// Unix format descriptions
90+
CronConverterU2Q.describeUnix('0 12 * * *'); // "At 12:00 PM"
91+
CronConverterU2Q.describeUnix('*/15 * * * *'); // "Every 15 minutes"
7692

77-
```javascript
78-
const description = c2q.describeUnix("5 * * * *");
79-
console.log(description); // Outputs: "Every 5 minutes"
93+
// Quartz format descriptions
94+
CronConverterU2Q.describeQuartz('0 0 8 * * ?'); // "At 8:00 AM"
95+
CronConverterU2Q.describeQuartz('0 */5 * * * ?'); // "Every 5 minutes"
8096
```
8197

82-
#### Describe Quartz Cron Expressions:
98+
## 🤝 Contributing
8399

84-
```javascript
85-
const description = c2q.describeQuartz("0 0 8 * * ?");
86-
console.log(description); // Outputs: "At 8 o'clock"
87-
```
100+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
101+
102+
1. Fork the repository
103+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
104+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
105+
4. Push to the branch (`git push origin feature/amazing-feature`)
106+
5. Open a Pull Request
107+
108+
## 📄 License
88109

89-
## License
90-
This project is licensed under the [MIT License](https://opensource.org/license/mit/)
110+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
91111

112+
## 💬 Support
92113

93-
### Contributing
94-
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
114+
- 📧 Email: rahu619@gmail.com
115+
- 💻 GitHub Issues: [Create an issue](https://github.com/rahu619/cron-converter-u2q/issues)
116+
- ⭐ Star the repository if you find it useful!
95117

96-
Please make sure to update tests as appropriate.
118+
## 🙏 Acknowledgments
97119

98-
### Support
99-
Any feedback, suggestions, or contributions are highly appreciated!
120+
- Thanks to all contributors who have helped shape this project
121+
- Inspired by the need for a simple, reliable cron expression converter
122+
- Built with TypeScript for better developer experience
100123

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "cron-converter-u2q",
3-
"version": "1.2.0",
2+
"name": "@rahu619/cron-converter-u2q",
3+
"version": "1.2.1",
44
"description": "Converts cron expressions between unix and quartz formats",
55
"main": "lib/index.js",
66
"types": "types/index.d.ts",
@@ -19,7 +19,10 @@
1919
],
2020
"license": "MIT",
2121
"homepage": "https://github.com/rahu619/cron-converter-u2q",
22-
"repository": "https://github.com/rahu619/cron-converter-u2q",
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/rahu619/cron-converter-u2q.git"
25+
},
2326
"devDependencies": {
2427
"@types/jest": "^29.5.3",
2528
"@types/mocha": "^10.0.1",

0 commit comments

Comments
 (0)