![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
moment-lite
Advanced tools
一直很喜欢 `moment.js`,但是它有时候太臃肿了(好比语言包问题),而且不够函数式(`moment().add(1, 'days')`的副作用...),所以我就写了个非常轻量级的 `moment-lite.js`。
一直很喜欢 moment.js
,但是它有时候太臃肿了(好比语言包问题),而且不够函数式(moment().add(1, 'days')
的副作用...),所以我就写了个非常轻量级的 moment-lite.js
。
后来同事告诉说已经有一个很好的 moment.js 替代品了:https://date-fns.org/。Well...也没有关系,就当自己练手吧。我设计的 API 跟它们都不太一样。
目标:
import moment from 'moment-lite';
const now = moment();
console.log(now.format('YYYY-MM-DD HH:mm:ss'));
const now = moment();
/**
* moment.prototype.format
* 格式化日期
*/
const str = now.format('YYYY-MM-DD');
/**
* moment.prototype.add(num, unit)
* 增加日期
*/
const oneMonthLater = now.add(30, 'days');
FAQs
一直很喜欢 `moment.js`,但是它有时候太臃肿了(好比语言包问题),而且不够函数式(`moment().add(1, 'days')`的副作用...),所以我就写了个非常轻量级的 `moment-lite.js`。
We found that moment-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.