Skip to content

Commit

Permalink
feat: first version
Browse files Browse the repository at this point in the history
  • Loading branch information
Farenheith committed Apr 7, 2023
1 parent 9097bbe commit fc8b723
Show file tree
Hide file tree
Showing 19 changed files with 3,286 additions and 1,363 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This is a basic workflow to help you get started with Actions

name: benchmark
on:
pull_request:
branches: [master, develop]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: install
run: npm ci
- name: 'Test'
run: npm run test:benchmark
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
14
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
[![Test Coverage](https://api.codeclimate.com/v1/badges/65e41e3018643f28168e/test_coverage)](https://codeclimate.com/github/Codibre/sonic-date/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/65e41e3018643f28168e/maintainability)](https://codeclimate.com/github/Codibre/sonic-date/maintainability)
[![Packages](https://david-dm.org/Codibre/sonic-date.svg)](https://david-dm.org/Codibre/sonic-date)
[![npm version](https://badge.fury.io/js/%40codibre%2Fsonic-date.svg)](https://badge.fury.io/js/%40codibre%2Fsonic-date)
[![npm version](https://badge.fury.io/js/sonic-date.svg)](https://badge.fury.io/js/sonic-date)

Never forget to write your readme! Also, don't forget to add codeclimate key to your github environment variables (as **CC_TEST_REPORTER_ID**) and to update the url here with the one provided by them!
Sonic that is a fluent implementation for some of the **date-fns** functions heavily focused on performance.
As you can see, sonic-date is more than 4 times faster than **date-fns**

```
moment x 136,114 ops/sec ±2.23% (90 runs sampled)
date-fns x 583,665 ops/sec ±0.54% (98 runs sampled)
sonic-date x 2,613,432 ops/sec ±0.73% (93 runs sampled)
```

The catch is that in our implementation is not immutable, and many of the type checking date-fns does we do not. So, although date-fns is safer for a general purpose use, sonic-date is really faster and best to be used in safer environments, like a back-end service.

We'll add more methods from date-fns by demand, always caring about performance and precision in the first place.

## How to Install

Expand Down
5 changes: 5 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"entryFile": "index"
}
Loading

0 comments on commit fc8b723

Please sign in to comment.