Skip to content

Commit

Permalink
patch texample
Browse files Browse the repository at this point in the history
  • Loading branch information
paed01 committed Jul 24, 2024
1 parent 63c2ce4 commit a2818e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ setTimeout(() => {
}, 2000);
```

With arguments:

```javascript
import * as ck from 'chronokinesis';
import assert from 'node:assert';

ck.freeze(1980, 0, 1);

assert.equal(true, ck.isKeepingTime());
assert.deepEqual(new Date(), new Date(1980, 0, 1));
```

or use with [`moment`](http://momentjs.com):

```javascript
Expand Down Expand Up @@ -180,10 +192,11 @@ Returns [`TimeZoneTraveller` api](#new-timezonetravellertimezone)
```javascript
import * as ck from 'chronokinesis';

ck.reset();

const tz = ck.timezone('Asia/Shanghai');

// Now in Shanghai
console.log(new Date());
console.log('Now in Shanghai', new Date());

tz.freeze();
```
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const rules = {
'no-undef': 2,
'no-underscore-dangle': 0,
'no-unused-expressions': 2,
'no-use-before-define': 0,
'no-unused-vars': 2,
'no-use-before-define': ['error', 'nofunc'],
'no-var': 2,
'no-with': 2,
'prefer-const': ['error', { destructuring: 'all' }],
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"lint": "eslint . --cache && prettier . --check --cache",
"test:lcov": "c8 -r lcov -r text mocha && npm run lint",
"cov:html": "c8 mocha -R dot && c8 report --reporter html",
"posttest": "npm run lint && npm run dist && texample",
"posttest": "npm run lint && npm run dist && texample -g",
"prepack": "npm run dist",
"dist": "npm run toc && rollup -c"
},
Expand All @@ -54,8 +54,8 @@
"fake now"
],
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"c8": "^9.1.0",
"@rollup/plugin-commonjs": "^26.0.1",
"c8": "^10.1.2",
"chai": "^5.1.0",
"eslint": "^9.3.0",
"lodash.clonedeep": "^4.5.0",
Expand All @@ -64,6 +64,6 @@
"moment": "^2.30.1",
"prettier": "^3.2.5",
"rollup": "^4.12.1",
"texample": "^0.0.5"
"texample": "^0.0.6"
}
}

0 comments on commit a2818e6

Please sign in to comment.