{"_id":"convict-format-with-moment","_rev":"3-461cc2896ba651679fe952df2852fdda","name":"convict-format-with-moment","dist-tags":{"latest":"6.2.0"},"versions":{"6.0.0":{"author":{"name":"Lloyd Hilaiel","email":"lloyd@hilaiel.com","url":"http://lloyd.io"},"name":"convict-format-with-moment","description":"Formats 'duration' and 'timestamp' for convict","keywords":["convict","convict-format","duration","timestamp","moment"],"version":"6.0.0","license":"Apache-2.0","homepage":"https://github.com/mozilla/node-convict","repository":{"type":"git","url":"https://github.com/mozilla/node-convict/tree/master/packages/convict-format-with-moment"},"bugs":{"url":"https://github.com/mozilla/node-convict/issues"},"engines":{"node":">=6"},"main":"src/main.js","dependencies":{"moment":"^2.24.0"},"gitHead":"7f974daa6eb6088b7f366fd0b450634e52d6f211","_id":"convict-format-with-moment@6.0.0","_nodeVersion":"12.16.3","_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (darwin)","dist":{"integrity":"sha512-OM43J47HsEUZyhekydgEYRJbr6vT6Wvy1g63SfNENaKt+0hlJOYnAUXBaiaud1IwvjoLRj1YQ/faWhvZbg9HEQ==","shasum":"f13d921f664efc21179c3d0c3332ebe83d84d8da","tarball":"https://registry.npmjs.org/convict-format-with-moment/-/convict-format-with-moment-6.0.0.tgz","fileCount":4,"unpackedSize":3775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetYrJCRA9TVsSAnZWagAABYwP/jKhWqYPGZlkV+mNUhjB\nTTho5XLR40/zxS47KjLBZ9ZZJpgd9exsdt84aOUpqxPY1ltEsAQHk2V+vbnL\nZdFd89kt7t7xkhq45cfFS6srQA0CjHu5rjFm8F4IL+Fhau/edcmj1hn9aKz3\n4f2BxPPyQBV3BP5Q7oqs9QYiPNkHz1TtD1ZNr5qV/PtX9tYNPlNY64yEeZjR\n4KbZ11+Qf9cQbLLFb0sVT79L1eHZW973Jvo4edrJU2CfWUL7AzFZO+lPhGVD\nWnEbDL3H64AIBt2E6hsDttx54mlsoTLG7ijMTZy00hXP2N/ko2Bkk7h/h7+o\nhx++9VJlFCJB2BSeHyojDUJFBvqP0XCsJDXk9jwNDz8NSywzMlGPaOCCmPTv\nEY7UPUqdYm5Fx64UrcYdP8TEUxSahDCsVZRxxOpfp0j2Gezxw9drqGqow4Lw\n7f1JJEqLw51XF8JILLHb4UFyM03PO4tJh54c34xf2UianJSdG8LW5hp8eZ9f\nvbUD7OmKvlM6WvXpil5nhTGyOouvRO9R4F0aLcrLXjfEEmjIt7GEVXOEQVaA\nX6OL7L14GWbchIduhPnj24GmlgGxZpclB24rcWHczpRj/Tpy2FFQf2hflk4i\nvfwORYqdlt3cQM9V5ZvDK8OP3/iv7wbcBye+PG/nluiEOI7FpBRH8Un7++in\n1m3X\r\n=kptY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEzGf7zkzc8/P5svCnqkmr0mD8hScatKQSEaxOdaSqOwIgMnXKlG2WXF+nWAjTEHf3Ggn7ubvVgZMP7YB8veQVYBg="}]},"maintainers":[{"name":"vladikoff","email":"vlad@vladikoff.com"}],"_npmUser":{"name":"vladikoff","email":"vlad@vladikoff.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convict-format-with-moment_6.0.0_1588955849052_0.8801007343564546"},"_hasShrinkwrap":false},"6.0.1":{"author":{"name":"Lloyd Hilaiel","email":"lloyd@hilaiel.com","url":"http://lloyd.io"},"name":"convict-format-with-moment","description":"Formats 'duration' and 'timestamp' for convict","keywords":["convict","convict-format","duration","timestamp","moment"],"version":"6.0.1","license":"Apache-2.0","homepage":"https://github.com/mozilla/node-convict","repository":{"type":"git","url":"https://github.com/mozilla/node-convict/tree/master/packages/convict-format-with-moment"},"bugs":{"url":"https://github.com/mozilla/node-convict/issues"},"engines":{"node":">=6"},"main":"src/main.js","dependencies":{"moment":"^2.24.0"},"gitHead":"7e068d8e41375b065ffe3c14376092d9342a4475","_id":"convict-format-with-moment@6.0.1","_nodeVersion":"14.16.0","_npmVersion":"lerna/3.22.1/node@v14.16.0+x64 (darwin)","dist":{"integrity":"sha512-6tf8eIUYJxBrljiiO4oFbPibNHEpXkPprcEvJpgxNX2ldzgaCxKCWMm916I3ignBFm2Hc9UDf+uNn15zCRcU/g==","shasum":"96e76f689b2201bce03fcfddadba83b8e7ad70cd","tarball":"https://registry.npmjs.org/convict-format-with-moment/-/convict-format-with-moment-6.0.1.tgz","fileCount":4,"unpackedSize":3890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSo5rCRA9TVsSAnZWagAA2VAP/iMQn47eTsDBIiCp3h6L\nHsZY1mMs2873KYHv3ABsfJjQWVmYNSnd7NbQ+xDnoYE/QXyVToUBmqk/9ugg\nqXzKiK/Ip5BPt14wB1ANvw82hT+YbDLxTW6I5mLzjVjtGGsisRFZpkTsBDR6\nbk4QLqzOdP8/uFKW/E6CMPcZVAx9BGx0kxAmNI8HNXn8u+pxAIEKnPR7d+R1\n9+lfAzLuiEu1Pv9AssGuplKeXhzzqO9dTVv/70myJDN5iQJMBBUw1y4NjZwr\nPsioqOLM9RrcvZMgC88uXcz7i3v5CEme3809AootngsvfsLkzD/EGaOKuCyq\n8UhYNRxAUAiPvf1qC/4SxQsDSRQ538eHelSUlE3dPMVK2v7JAJlKoN2PzZ97\nfQKMm1JmynLaxW0ZhPRgf544qcr0kCwsRXGtwJ99V1nsZimxild/ZQrOZXwR\nmfwedXRaTg3mjF+8SbTJpJ327dqtqbfa6/HGQGf/pbpGmJ40/bt0Nscyn/Ur\n9MbnhDrgVOfLFaLQQ7efUPyYYbihiv9AIBxb9AJhZooWwEIHOGZYLjethR4b\nn6W2THkqFs7XEhq9tomp6B5A5ZcTjEJG0ixaz0KhfGde9I8DP6NzhLQPCel2\nz2hRuwn5Zb2bdg0QZtkfsNB9f4btwCod/R7ReWAg6ykmk56Wjq01EwePYhUm\nvZPz\r\n=xb1Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaXBVBoJVpzA8hdhK3KPFbV5AuV8pHW4rLz2ynq+cvkwIhALz4IXUmCFP6UPWA9zHHi34DpSv6EkeL27ETBe+Lcbkg"}]},"_npmUser":{"name":"dannycoates","email":"dannycoates@gmail.com"},"directories":{},"maintainers":[{"name":"vladikoff","email":"vlad@vladikoff.com"},{"name":"dannycoates","email":"dannycoates@gmail.com"},{"name":"rfkelly","email":"rfkelly@mozilla.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convict-format-with-moment_6.0.1_1615498859162_0.30071423199375813"},"_hasShrinkwrap":false},"6.2.0":{"author":{"name":"Lloyd Hilaiel","email":"lloyd@hilaiel.com","url":"http://lloyd.io"},"name":"convict-format-with-moment","description":"Formats 'duration' and 'timestamp' for convict","keywords":["convict","convict-format","duration","timestamp","moment"],"version":"6.2.0","license":"Apache-2.0","homepage":"https://github.com/mozilla/node-convict","repository":{"type":"git","url":"git+https://github.com/mozilla/node-convict.git#master"},"bugs":{"url":"https://github.com/mozilla/node-convict/issues"},"engines":{"node":">=6"},"main":"src/main.js","dependencies":{"moment":"^2.29.1"},"gitHead":"bdd8a4e55a236c2ccb2a2d6062c9ac3ddec34af6","_id":"convict-format-with-moment@6.2.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/4.0.0/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-0+LoBKLk/2SP1gyZUPkrZOgRXL0ud/rhEYzdAyJmMMZgNm31OUcgnupny9KMW5xMbMgUd25M0ohIPWYsHV26CA==","shasum":"fc2f71ab654eecbbd2f5af1a679e44a4a15304f4","tarball":"https://registry.npmjs.org/convict-format-with-moment/-/convict-format-with-moment-6.2.0.tgz","fileCount":4,"unpackedSize":3890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9oELCRA9TVsSAnZWagAAlV8P/3V6ixuRYbFVhY96WLL9\ni/uNac0y460pUZF+OtsLJxSXJzXgvqz2ZQFa66oy5nBt8OLaqrauXyKNfXZO\nwQrnBycTMbjI+YWjW3LuRoklzwoijrVag5GwkB9c3ImKFeWVCfxBJxY6gDwM\njCFRcg8+RpCQdeI0FS4HSU/XlXCv9jGqWdMPIf2GJhyMtY6TQWV7WJ+dgk7k\nTnct64zP8Dy0xamMkt6D+aXymuuFVSMbjelrwHptvneaGjbcNTONanSzrJbu\nrsHt61RdclDEjf3qMH7D0j3JtZ3KBsNSwZ8Cu3q7u0XBmRI+2F/c/3wHep4d\nseNywql1alNgHRvIuXD2vVzql2dHpUZxtPG1T13DhzrXJR5tY9yPu3cqcRIp\ncjEMYmXQCi+fNq3+jzkYldNkpPjjjJWlV/3tOxH6Ht14Op89oHzUhPLVAhhE\nYnLLXmdLYiM8K6IgMI8Xin0VxdJg5eH05RD20h8Fjh05W/MIFiO/p9hBmfWV\nnePUbE9zrH3pC48UkDAjWWYsZDOUItUHrlC6Mso6qbeVPUomQoWVNYZfaDra\nw4FMdX0qYwQkDNx6jJQVadR0b2tj1E275nVrUpabPc9jIgXvdt/3du31/8OC\nYBbH0HnUqvdpD2CZ6BODbCxXAm6EBvoag9tvUzaRk8Y4G1BMUmmcqc/nD03z\nv03g\r\n=+8Qn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkzO5GQN6EttoRUpqN7T+Pkm+jWTLF/wISKupcJQRNlwIhAJTLUKFpGX78cz/UegrEXwSjrbgF9QXjXfn1bx9HcwTb"}]},"_npmUser":{"name":"madarche","email":"ma.darche@cynode.org"},"directories":{},"maintainers":[{"name":"vladikoff","email":"vlad@vladikoff.com"},{"name":"dannycoates","email":"dannycoates@gmail.com"},{"name":"madarche","email":"ma.darche@cynode.org"},{"name":"rfkelly","email":"rfkelly@mozilla.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convict-format-with-moment_6.2.0_1626767627103_0.5934023005226632"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-08T16:37:29.052Z","6.0.0":"2020-05-08T16:37:29.239Z","modified":"2022-04-27T16:36:01.454Z","6.0.1":"2021-03-11T21:40:59.304Z","6.2.0":"2021-07-20T07:53:47.239Z"},"maintainers":[{"name":"vladikoff","email":"vlad@vladikoff.com"},{"name":"dannycoates","email":"dannycoates@gmail.com"},{"name":"madarche","email":"ma.darche@cynode.org"},{"name":"rfkelly","email":"rfkelly@mozilla.com"}],"description":"Formats 'duration' and 'timestamp' for convict","homepage":"https://github.com/mozilla/node-convict","keywords":["convict","convict-format","duration","timestamp","moment"],"repository":{"type":"git","url":"git+https://github.com/mozilla/node-convict.git#master"},"author":{"name":"Lloyd Hilaiel","email":"lloyd@hilaiel.com","url":"http://lloyd.io"},"bugs":{"url":"https://github.com/mozilla/node-convict/issues"},"license":"Apache-2.0","readme":"# Convict-format-with-moment\n\n[![NPM version](http://img.shields.io/npm/v/convict-format-with-moment.svg)](https://www.npmjs.org/package/convict-format-with-moment)\n\nFormats `duration` and `timestamp` for convict with [Moment.js](http://momentjs.com/).\n\n\n## Install\n\n```shellsession\nnpm install convict-format-with-moment\n```\n\n\n## Usage\n\nAn example `config.js` file:\n\n```javascript\nconst convict = require('convict');\nconst convict_format_with_moment = require('convict-format-with-moment');\n\n// Add all formats\nconvict.addFormats(convict_format_with_moment);\n\n// Or add only specific formats:\n// convict.addFormat(convict_format_with_moment.duration);\n// etc.\n\n// Define a schema\nvar config = convict({\n  format: {\n    format: 'duration'\n  },\n  format: {\n    format: 'timestamp'\n  }\n});\n```\n\n\n### Validation\n\nValidation done through Moment.js:\n\n* `duration` - milliseconds or a human readable string (e.g. 3000, \"5 days\")\n* `timestamp` - Unix timestamps or date strings recognized by Moment.js\n\n\n### Coercion\n\nConvict will automatically coerce environmental variables from strings to their proper types when importing them. For instance, values with the format `int`, `nat`, `port`, or `Number` will become numbers after a straight forward `parseInt` or `parseFloat`. `duration` and `timestamp` are also parse and converted into numbers, though they utilize Moment.js for date parsing.\n","readmeFilename":"README.md"}