{"id":23425348,"url":"https://github.com/project-nv/nvjs-data-gen","last_synced_at":"2025-10-08T19:27:36.240Z","repository":{"id":65387398,"uuid":"565374805","full_name":"project-nv/nvjs-data-gen","owner":"project-nv","description":"Data generator for NightVision charts","archived":false,"fork":false,"pushed_at":"2022-12-18T08:52:46.000Z","size":426,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T20:31:22.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/project-nv.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":"2022-11-13T07:35:19.000Z","updated_at":"2023-01-09T12:16:20.000Z","dependencies_parsed_at":"2023-01-29T18:45:17.057Z","dependency_job_id":null,"html_url":"https://github.com/project-nv/nvjs-data-gen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/project-nv/nvjs-data-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-nv%2Fnvjs-data-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-nv%2Fnvjs-data-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-nv%2Fnvjs-data-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-nv%2Fnvjs-data-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/project-nv","download_url":"https://codeload.github.com/project-nv/nvjs-data-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-nv%2Fnvjs-data-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000706,"owners_count":26082805,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-23T05:11:39.489Z","updated_at":"2025-10-08T19:27:36.222Z","avatar_url":"https://github.com/project-nv.png","language":"JavaScript","readme":"\n# Data generator for NightVision charts\n\n## Install\n\n`npm i @nvjs/data-gen`\n\n## Use\n\n```js\n\nimport Degen from '@nvjs/data-gen'\n\nasync function main() {\n\n    let degen = new Degen()\n    let data = await degen.get('APEUSDT', '15m', 420)\n\n    console.log(data)\n}\n\nmain()\n\n```\n\n## Examples\n\n```js\n// returns a simple ochlv dataset\nget('APEUSDT', '1h', 4200)\n\n// Text-based data constructor\nget(`\n    indexBased;\n    $Candles {\n        name=Ape Tether US Binance | data=@(APEUSDT, 1h, 420)\n    }\n    + Spline {name=EMA, 10 | data=ema(close, 10)}\n    + Spline {name=EMA, 20 | data=ema(close, 20)};\n    Spline {\n        name=RSI, 14 |\n        data=rsi(close, 14) |\n        settings={ precision: 2 }\n    };\n    #pane0 { scales: { A: { precision: 2 } } };\n`)\n```\n\n- `indexBased` sets the index-based mode\n- `$` means that `Candles` is the main overlay.\n- `@` loads data from Binance\n- `rsi()`, `ema()` calculate TA with [ta.js](https://github.com/Bitvested/ta.js) lib\n- `#` is for the pane settings\n\nLines should be separated with `;`. Each line is either:\n\n- Overlay1 + Overlay2 + ... + OverlayN\n- indexBased flag\n- pane settings descriptor\n\nOverlay props are separated with `|`:\n\n```js\nSpline { name = EMA, 20 | data = ema(close, 20) }\n```\n\n## Advanced Examples\n\n```js\n// You can filter the main data to only one component:\nget(`\n    Spline {\n        name=Ape Tether US Binance |\n        data=@(APEUSDT, 1h, 420, close)\n    };\n`)\n\n// Or you can get a separate component of OHLCV as\n// an overlay data:\nget(`\n    $Candles {\n        name=Ape Tether US Binance |\n        data=@(APEUSDT, 1h, 420) |\n    }\n    + Volume {\n        name = Vol |\n        data = volume\n    };\n`)\n\n// If that is not enough, you are able to build data\n// element-by-element with iter() function:\nget(`\n    $Candles {\n        name=Ape Tether US Binance | data=@(APEUSDT, 1h, 420) |\n        settings={ precision: 2 }\n    }\n    + Volume {\n        name = Vol |\n        data = iter(i =\u003e {\n            if (close[i] \u003e open[i]) {\n                return [volume[i], 1] // Volume Up\n            } else {\n                return [volume[i], -1] // Volume Down\n            }\n        })\n    };\n`)\n\n// Add scripts (use `!` prefix):\n\nget(`\n    $Candles {\n        name=Ape Tether US Binance | data=@(APEUSDT, 1h, 420) |\n        settings={ precision: 2 }\n    }\n    + !EMA {\n        props = {\n            length: 12\n        }\n    };\n`)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-nv%2Fnvjs-data-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproject-nv%2Fnvjs-data-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-nv%2Fnvjs-data-gen/lists"}