Skip to content

Commit

Permalink
chore(release): 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oritwoen committed Jan 6, 2023
0 parents commit 46caebf
Show file tree
Hide file tree
Showing 12 changed files with 3,733 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
coverage
node_modules
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 1.0.0 (2023-01-06)
- Initial release
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 - Dominik Opyd (Oritwoen)

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.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<h1 align='center'>pruni</h1>

<p align="center">
<img src="./pruni.png">
</p>

<p align="center">
<a href="https://www.npmjs.com/package/pruni" target="_blank"><img src="https://img.shields.io/npm/v/pruni?style=flat&colorA=130f40&colorB=474787" alt="npm version"></a>
<a href="https://www.npmjs.com/package/pruni" target="_blank"><img src="https://img.shields.io/bundlephobia/min/pruni?style=flat&colorA=130f40&colorB=474787" alt="npm size"></a>
<a href="https://www.npmjs.com/package/pruni" target="_blank"><img src="https://img.shields.io/npm/dm/pruni?flat&colorA=130f40&colorB=474787" alt="npm downloads"></a>
<a href="https://github.com/oritwoen/pruni" target="_blank"><img src="https://img.shields.io/github/stars/oritwoen/pruni?flat&colorA=130f40&colorB=474787" lt="github stars"></a>
</p>

<p align="center">
Calculation of information units in any form and any format.
</p>

## Why?

When I wanted to create a script for calculating the profitability of cryptocurrency mining, I encountered a problem with formatting information units to one format from all potential formats.

I didn't feel like formatting or converting it in different formats every time, so I created this package.

## Install

```bash
npm install --save pruni

# Using pnpm
pnpm add pruni

# Using yarn
yarn add pruni
```


## Usage

```ts
import { useCalculatedUnits } from 'pruni'

//Number
useCalculatedUnits(9, 'megabytes', 'kilobytes') // return 9000
useCalculatedUnits(7, 'mh/s', 'kilohash per second') // return 7000
useCalculatedUnits(3, 'mega sol per second', 'ks/s') // return 3000

//Pretty
useCalculatedUnits(1, 'mb', 'kb', { pretty: true }) // return 1000 KB
useCalculatedUnits(1, 'gh', 'mh', { pretty: true, unit: 'h' }) // return 1000 MH
useCalculatedUnits(1, 'msol', 'ksol', { pretty: true, unit: 'sol' }) // return 1000 KSOL

```

## License

MIT License © 2023 [Dominik Opyd](https://github.com/oritwoen)
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "pruni",
"version": "1.0.0",
"description": "Calculation of information units in any form and any format.",
"repository": "oritwoen/pruni",
"keywords": ["math", "crypto", "units", "calc", "format", "mining", "hash"],
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"dev": "vitest dev",
"lint": "eslint --ext .ts,.js,.mjs,.cjs .",
"test": "pnpm lint && vitest run --coverage",
"build": "unbuild",
"prepack": "unbuild",
"release": "pnpm test && standard-version && git push --follow-tags && pnpm publish"
},
"devDependencies": {
"vitest": "0.26.3",
"eslint": "8.31.0",
"unbuild": "1.0.2",
"typescript": "4.9.4",
"standard-version": "9.5.0",
"@vitest/coverage-c8": "0.26.3"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 46caebf

Please sign in to comment.