{"id":17888210,"url":"https://github.com/poga/rats","last_synced_at":"2025-04-03T02:42:42.823Z","repository":{"id":137993932,"uuid":"80823892","full_name":"poga/rats","owner":"poga","description":"javascript encoder/decoder for RATS","archived":false,"fork":false,"pushed_at":"2017-03-24T21:14:41.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T16:44:26.092Z","etag":null,"topics":["binaryformat","compression","protocol-buffers","timeseries"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-03T11:37:51.000Z","updated_at":"2017-09-02T20:51:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc6b2b8e-0b07-4bfe-9189-bc8d1c99f771","html_url":"https://github.com/poga/rats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poga%2Frats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poga%2Frats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poga%2Frats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poga%2Frats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poga","download_url":"https://codeload.github.com/poga/rats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927809,"owners_count":20856193,"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":["binaryformat","compression","protocol-buffers","timeseries"],"created_at":"2024-10-28T13:36:49.479Z","updated_at":"2025-04-03T02:42:42.798Z","avatar_url":"https://github.com/poga.png","language":"JavaScript","readme":"# rats.js\n\nJavaScript implementation for [RATS](https://github.com/random-access-timeseries/spec).\n\n`npm i rats-js`\n\n## Usage\n\n```js\nvar RATS = require('rats')\n\nvar rats = new RATS('./rats')\nrats.append({foo: 'bar'}, function (err) {})\nrats.currentOffset // === 1\nrats.get(0, function (err, data) {})\nrats.range(0, 100, function (err, list) {})\n```\n\n## API\n\n#### `var rats = new RATS(path, opts)`\n\nCreate a new RATS at `path`. Options `opts` include:\n\n* maxSegmentSize: maximum size of a segment. default:5MB\n\n#### `rats.currentOffset`\n\nReturns the current offset.\n\n#### `rats.append(object, [time], [cb(err)])`\n\nAppend an `object` to the RATS. you can specify the timestamp of this append with `time` (unix time in seconds).\n\n#### `rats.currentIndex()`\n\nThe index file currently in use.\n\n#### `rats.currentLog()`\n\nThe log file currently in use.\n\n#### `rats.get(offset, cb(err, data))`\n\nGet the data at `offset`.\n\n#### `rats.range(startTime, [endTime], cb(err,list))`\n\nGet the data(s) in the range.\n\n`endTime` by default will be the timestamp of the last object in the RATS.\n\n\n\n## License\n\nThe MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoga%2Frats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoga%2Frats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoga%2Frats/lists"}