{"id":21842978,"url":"https://github.com/ullmark/fluent-time.js","last_synced_at":"2025-04-14T12:05:18.075Z","repository":{"id":5389710,"uuid":"6578228","full_name":"ullmark/fluent-time.js","owner":"ullmark","description":"a wrapper around date, timeout and intervals that provide a fluent api.","archived":false,"fork":false,"pushed_at":"2014-06-23T07:54:30.000Z","size":306,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-14T12:05:13.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ullmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-07T11:27:12.000Z","updated_at":"2024-06-05T14:52:49.000Z","dependencies_parsed_at":"2022-07-06T14:33:11.579Z","dependency_job_id":null,"html_url":"https://github.com/ullmark/fluent-time.js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ullmark%2Ffluent-time.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ullmark%2Ffluent-time.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ullmark%2Ffluent-time.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ullmark%2Ffluent-time.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ullmark","download_url":"https://codeload.github.com/ullmark/fluent-time.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877983,"owners_count":21176243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T22:13:54.353Z","updated_at":"2025-04-14T12:05:18.052Z","avatar_url":"https://github.com/ullmark.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-time.js [![Build Status](https://secure.travis-ci.org/ullmark/fluent-time.js.png?branch=master)](http://travis-ci.org/ullmark/fluent-time.js)\nfluent time works as a wrapper around `setTimeout` and `setInterval` and aims to provide a simpler api for them.\n\n## installation\n#### node.js\n```\nnpm install fluent-time\n```\n\n#### bower\n```\nbower install fluent-time\n```\n\n#### regular include\ndownload `fluent-time.js` or `fluent-time.min.js` and include it.\n\n## accessing the api.\nwe don't want to pollute your global/module scope without asking, but it gives the best looking fluent code. So you can do it yourself, like this;\n\n#### node.js\n```javascript\nvar every = require('fluent-time').every;\n```\n\n#### require.js\n```javascript\ndefine(['./path/to/fluent-time.js'], function(FluentTime) {\n  var every = FluentTime.every;\n});\n```\n\n#### browser\n```javascript\nvar every = FluentTime.every;\n```\n\n## intervals\n```javascript\nevery(5).seconds(function() {\n  // code...\n});\n\nevery(4).hours().and(2).minutes(function() {\n  // code...\n});\n\nevery().hour().and(10).seconds(function () {\n  // code...\n});\n\n```\n\n```javascript\nevery(5).seconds(function(interval) {\n  interval.times; // will be a number of how many times the interval has occured.\n});\n```\n\n```javascript\nevery(5).minutes(function(interval) {\n  if(someCondition) {\n    interval.skip(2); // skip the next two executions.\n  }\n\n  if (interval.times === 100) {\n    interval.cancel(); // cancel the interval.\n  }\n});\n```\n\n## timeouts\n```javascript\n// runs the provided function after 10 seconds\nafter(10).seconds(function() {\n\n});\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Markus Ullmark\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fullmark%2Ffluent-time.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fullmark%2Ffluent-time.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fullmark%2Ffluent-time.js/lists"}