Socket
Socket
Sign inDemoInstall

dayjs

Package Overview
Dependencies
0
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.1 to 2.0.0-alpha.1

.eslintrc.js

157

package.json
{
"name": "dayjs",
"version": "1.11.1",
"description": "2KB immutable date time library alternative to Moment.js with the same modern API ",
"main": "dayjs.min.js",
"types": "index.d.ts",
"scripts": {
"test": "TZ=Pacific/Auckland npm run test-tz && TZ=Europe/London npm run test-tz && TZ=America/Whitehorse npm run test-tz && npm run test-tz && jest",
"test-tz": "date && jest test/timezone.test --coverage=false",
"lint": "./node_modules/.bin/eslint src/* test/* build/*",
"prettier": "prettier --write \"docs/**/*.md\"",
"babel": "cross-env BABEL_ENV=build babel src --out-dir esm --copy-files && node build/esm",
"build": "cross-env BABEL_ENV=build node build && npm run size",
"sauce": "npx karma start karma.sauce.conf.js",
"test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2 && npm run sauce -- 3",
"size": "size-limit && gzip-size dayjs.min.js"
},
"pre-commit": [
"lint"
"version": "2.0.0-alpha.1",
"description": "2KB immutable date time library alternative to Moment.js with the same modern API.",
"keywords": [
"dayjs",
"date"
],
"size-limit": [
"homepage": "https://day.js.org",
"license": "MIT",
"author": "iamkun",
"contributors": [
{
"limit": "2.99 KB",
"path": "dayjs.min.js"
"name": "三咲智子",
"email": "sxzz@sxzz.moe",
"url": "https://github.com/sxzz"
}
],
"jest": {
"roots": [
"test"
],
"testRegex": "test/(.*?/)?.*test.js$",
"testURL": "http://localhost",
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*"
]
"funding": "https://opencollective.com/dayjs",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
},
"release": {
"prepare": [
{
"path": "@semantic-release/changelog"
},
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
]
]
},
"keywords": [
"dayjs",
"date",
"time",
"immutable",
"moment"
],
"author": "iamkun",
"license": "MIT",
"homepage": "https://day.js.org",
"unpkg": "./dist/index.iife.min.js",
"jsdelivr": "./dist/index.iife.min.js",
"repository": {

@@ -68,33 +38,48 @@ "type": "git",

},
"scripts": {
"clean": "rimraf dist",
"build": "esno build/index.ts",
"size": "pnpm run build && size-limit",
"lint": "eslint . --ext .js,.ts,.json",
"lint:fix": "pnpm run lint -- --fix",
"format": "prettier . --write",
"test": "vitest"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.44",
"@babel/core": "^7.0.0-beta.44",
"@babel/node": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.44",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^22.4.3",
"babel-plugin-external-helpers": "^6.22.0",
"cross-env": "^5.1.6",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-jest": "^21.15.0",
"gzip-size-cli": "^2.1.0",
"jasmine-core": "^2.99.1",
"jest": "^22.4.3",
"karma": "^2.0.2",
"karma-jasmine": "^1.1.2",
"karma-sauce-launcher": "^1.1.0",
"mockdate": "^2.0.2",
"moment": "2.27.0",
"moment-timezone": "0.5.31",
"ncp": "^2.0.0",
"pre-commit": "^1.2.2",
"prettier": "^1.16.1",
"rollup": "^2.45.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-terser": "^7.0.2",
"size-limit": "^0.18.0",
"typescript": "^2.8.3"
}
"@size-limit/file": "^7.0.8",
"@sxzz/eslint-config-prettier": "^2.1.1",
"@sxzz/eslint-config-ts": "^2.1.1",
"@types/node": "*",
"c8": "^7.11.2",
"esbuild": "^0.14.36",
"eslint": "^8.13.0",
"eslint-define-config": "^1.3.0",
"esno": "^0.14.1",
"fast-glob": "^3.2.11",
"moment": "^2.29.3",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"size-limit": "^7.0.8",
"ts-morph": "^14.0.0",
"typescript": "^4.6.3",
"utility-types": "^3.10.0",
"vitest": "^0.9.3"
},
"engines": {
"node": ">=14.17.0"
},
"size-limit": [
{
"limit": "2.99 KB",
"path": "dist/index.min.js"
},
{
"limit": "2.99 KB",
"path": "dist/index.min.mjs"
},
{
"limit": "2.99 KB",
"path": "dist/index.iife.min.js"
}
]
}

@@ -1,7 +0,22 @@

English | [简体中文](./docs/zh-cn/README.zh-CN.md) | [日本語](./docs/ja/README-ja.md) | [Português Brasileiro](./docs/pt-br/README-pt-br.md) | [한국어](./docs/ko/README-ko.md) | [Español (España)](./docs/es-es/README-es-es.md) | [Русский](./docs/ru/README-ru.md) | [Türkçe](./docs/tr/README-tr.md)
## TODO
<p align="center"><a href="https://day.js.org/" target="_blank" rel="noopener noreferrer"><img width="550"
src="https://user-images.githubusercontent.com/17680888/39081119-3057bbe2-456e-11e8-862c-646133ad4b43.png"
alt="Day.js"></a></p>
- [x] locale
- migrate plugins
- docs
---
English | [简体中文](./docs/zh-cn/README.zh-CN.md) | [日本語](./docs/ja/README-ja.md) | [Português Brasileiro](./docs/pt-br/README-pt-br.md) | [한국어](./docs/ko/README-ko.md) | [Español (España)](./docs/es-es/README-es-es.md) | [Русский](./docs/ru/README-ru.md)
<p align="center">
<a href="https://day.js.org/" target="_blank" rel="noopener noreferrer">
<img width="550"
src="https://user-images.githubusercontent.com/17680888/39081119-3057bbe2-456e-11e8-862c-646133ad4b43.png"
alt="Day.js"
>
</a>
</p>
<p align="center">Fast <b>2kB</b> alternative to Moment.js with the same modern API</p>
<p align="center">

@@ -20,5 +35,2 @@ <a href="https://unpkg.com/dayjs/dayjs.min.js"><img

<br>
<a href="https://saucelabs.com/u/dayjs">
<img width="750" src="https://user-images.githubusercontent.com/17680888/40040137-8e3323a6-584b-11e8-9dba-bbe577ee8a7b.png" alt="Sauce Test Status">
</a>
</p>

@@ -28,12 +40,16 @@

```js
dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
```ts
dayjs()
.startOf('month')
.add(1, 'day')
.set('year', 2018)
.format('YYYY-MM-DD HH:mm:ss')
```
* 🕒 Familiar Moment.js API & patterns
* 💪 Immutable
* 🔥 Chainable
* 🌐 I18n support
* 📦 2kb mini library
* 👫 All browsers supported
- 🕒 Familiar Moment.js API & patterns
- 💪 Immutable
- 🔥 Chainable
- 🌐 I18n support
- 📦 2kb mini library
- 👫 All browsers supported

@@ -60,3 +76,3 @@ ---

```javascript
```ts
dayjs('2018-08-08') // parse

@@ -81,3 +97,3 @@

```javascript
```ts
import 'dayjs/locale/es' // load on demand

@@ -89,2 +105,3 @@

```
📚[Internationalization](https://day.js.org/docs/en/i18n/i18n)

@@ -96,3 +113,3 @@

```javascript
```ts
import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand

@@ -109,18 +126,9 @@

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/dayjs#sponsor)]
[[Become a sponsor via Github](https://github.com/sponsors/iamkun/)] [[Become a sponsor via OpenCollective](https://opencollective.com/dayjs#sponsor)]
<a href="https://opencollective.com/dayjs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/3/avatar.svg"></a>
<a href="https://www.exoflare.com/open-source/?utm_source=dayjs&utm_campaign=open_source" target="_blank">
<img width="70" src="https://user-images.githubusercontent.com/17680888/162761622-1407a849-0c41-4591-8aa9-f98114ec2092.png">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/vendure-ecommerce" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/39629390?s=52&v=4"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/Velc" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/1551649?s=52&v=4"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/projectdiscovery" target="_blank"><img width="70" src="https://avatars.githubusercontent.com/u/50994705?s=52&v=4"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://opencollective.com/datawrapper" target="_blank"><img width="70" src="https://images.opencollective.com/datawrapper/c13e229/logo.png"></a>
## Contributors

@@ -127,0 +135,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc