diff --git a/README.md b/README.md index 6127c87..68eb8da 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ So, What are you waiting for? 🤔 | | [Chalk](./npm_Modules/chalk/) | [npm Chalk](https://www.npmjs.com/package/chalk) | [docs Chalk](https://github.com/chalk/chalk) | | **D** | | | | | [Debug](./npm_Modules/debug/) | [npm Debug](https://www.npmjs.com/package/debug) | | +| | [Date-fns](./npm_Modules/date-fns/) | [npm date-fns](https://www.npmjs.com/package/date-fns?activeTab=readme) | [doc](https://date-fns.org/docs/Getting-Started/) | | **E** | | | | | [Express](./npm_Modules/Express/) | [npm Express](https://www.npmjs.com/package/express) | [docs Express](https://expressjs.com/) | | | [Express/Router](./npm_Modules/Router/) | [npm Express/Router](https://www.npmjs.com/package/express-router) | [docs Express/Router](https://expressjs.com/en/guide/routing.html) | diff --git a/npm_Modules/date-fns/README.md b/npm_Modules/date-fns/README.md new file mode 100644 index 0000000..d9479b1 --- /dev/null +++ b/npm_Modules/date-fns/README.md @@ -0,0 +1,31 @@ + +# It's like [Lodash](https://lodash.com) for dates + +- It has [**200+ functions** for all occasions](https://date-fns.org/docs/Getting-Started/). +- **Modular**: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking. +- **Native dates**: Uses existing native type. It doesn't extend core objects for safety's sake. +- **Immutable & Pure**: Built using pure functions and always returns a new date instance. +- **TypeScript & Flow**: Supports both Flow and TypeScript +- **I18n**: Dozens of locales. Include only what you need. +- [and many more benefits](https://date-fns.org/) + +The library is available as an [npm package](https://www.npmjs.com/package/date-fns). +To install the package run: + +```bash +npm install date-fns --save +# or with yarn +yarn add date-fns +``` + +## Docs + +[See date-fns.org](https://date-fns.org/) for more details, API, +and other docs. + +
+ + +## License + +[MIT © Sasha Koss](https://kossnocorp.mit-license.org/) \ No newline at end of file diff --git a/npm_Modules/date-fns/date-fns.js b/npm_Modules/date-fns/date-fns.js new file mode 100644 index 0000000..9b6134d --- /dev/null +++ b/npm_Modules/date-fns/date-fns.js @@ -0,0 +1,11 @@ +import { compareAsc, format } from 'date-fns' + +format(new Date(2014, 1, 11), 'yyyy-MM-dd') +//=> '2014-02-11' + +const dates = [ + new Date(1995, 6, 2), + new Date(1987, 1, 11), + new Date(1989, 6, 10), +] +dates.sort(compareAsc) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 59460ca..47532e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "bootstrap": "^5.2.2", "chalk": "^5.1.2", "commander": "^9.4.1", + "date-fns": "^2.30.0", "express": "^4.18.2", "fastify": "^4.9.2", "fs": "^0.0.1-security", @@ -32,6 +33,17 @@ "wide-align": "^1.1.5" } }, + "node_modules/@babel/runtime": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@fastify/ajv-compiler": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", @@ -607,6 +619,21 @@ "node": ">= 0.10" } }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1772,6 +1799,11 @@ "node": ">= 12.13.0" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -2320,6 +2352,14 @@ } }, "dependencies": { + "@babel/runtime": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, "@fastify/ajv-compiler": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", @@ -2740,6 +2780,14 @@ "vary": "^1" } }, + "date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "requires": { + "@babel/runtime": "^7.21.0" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -3600,6 +3648,11 @@ "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==" }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", diff --git a/package.json b/package.json index 215cd40..bbf7201 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "bootstrap": "^5.2.2", "chalk": "^5.1.2", "commander": "^9.4.1", + "date-fns": "^2.30.0", "express": "^4.18.2", "fastify": "^4.9.2", "fs": "^0.0.1-security",