{"id":21231392,"url":"https://github.com/alienhoboken/electron-viewport","last_synced_at":"2026-04-20T06:01:37.981Z","repository":{"id":57221967,"uuid":"83469765","full_name":"AlienHoboken/electron-viewport","owner":"AlienHoboken","description":"Helps emulate and scale viewports in Electron","archived":false,"fork":false,"pushed_at":"2017-03-01T18:36:25.000Z","size":4,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T01:21:56.498Z","etag":null,"topics":["browserwindow","device-emulation","electron","electron-viewport","emulation","scale","scale-viewports","viewport","viewport-size","window"],"latest_commit_sha":null,"homepage":"","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/AlienHoboken.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}},"created_at":"2017-02-28T19:15:15.000Z","updated_at":"2018-05-29T18:01:34.000Z","dependencies_parsed_at":"2022-08-29T04:10:07.986Z","dependency_job_id":null,"html_url":"https://github.com/AlienHoboken/electron-viewport","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AlienHoboken/electron-viewport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienHoboken%2Felectron-viewport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienHoboken%2Felectron-viewport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienHoboken%2Felectron-viewport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienHoboken%2Felectron-viewport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienHoboken","download_url":"https://codeload.github.com/AlienHoboken/electron-viewport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienHoboken%2Felectron-viewport/sbom","scorecard":{"id":11845,"data":{"date":"2025-08-11","repo":{"name":"github.com/AlienHoboken/electron-viewport","commit":"3efaebc9b243e226309d2480656202a3b17f8435"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-14T14:47:05.890Z","repository_id":57221967,"created_at":"2025-08-14T14:47:05.890Z","updated_at":"2025-08-14T14:47:05.890Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749122,"owners_count":24814128,"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-08-23T02:00:09.327Z","response_time":69,"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":["browserwindow","device-emulation","electron","electron-viewport","emulation","scale","scale-viewports","viewport","viewport-size","window"],"created_at":"2024-11-20T23:46:40.735Z","updated_at":"2026-04-20T06:01:32.954Z","avatar_url":"https://github.com/AlienHoboken.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/electron-viewport.svg)]() [![npm](https://img.shields.io/npm/dt/electron-viewport.svg)]() [![npm](https://img.shields.io/npm/l/electron-viewport.svg)]()\n\n# electron-viewport\nelectron-viewport helps emulate and scale viewports. Viewport can emulate a device viewport, such as emulating a phone device or 4k display, and can scale a window (maintaining aspect ratio) to fit on screen.\n\n### Installation\n`npm install --save electron-viewport`\n\n### Instance Properties\n#### `viewport.width`\nWidth of the viewport to be represented\n\n#### `viewport.height`\nHeight of the viewport to be represented\n\n#### `viewport.emulate`\n`Boolean` indicating whether or not to emulate the given viewport size or simply scale to fit on current display.\n\n#### `viewport.opts`\nOptions passed to BrowserWindow on creation\n\n### Instance Methods\n#### `viewport.getWindow(width, height[, emulate][, options])`\n* `width` Integer - The width of the viewport to be represented\n* `height` Integer - The height of the viewport to be represented\n* `emulate` Boolean (optional) - Whether or not to use device emulation, simulating the actual viewport size given. If false, then the viewport it simply scaled while maintaining aspect ratio. Default is `false`\n* `options` Object (optional) - Options to be passed to the BrowserWindow on creation\n\nCreates and returns a [BrowserWindow](https://github.com/electron/electron/blob/master/docs/api/browser-window.md), enabling emulation on it if necessary.\n\n## Examples\n\n### Getting scaled width and height\n\n```javascript\nvar { width, height } = require('electron-viewport')(width, height)\n```\nSimply returns scaled dimensions so you may create your own window.\n\n### Creating a scaled window\n\n```javascript\nvar viewport = require('electron-viewport')(width, height)\nvar mainWindow = viewport.getWindow()\n```\nCreates a scaled BrowserWindow which fits on screen, with the width and height specified.\n\n### Scaled window with device emulation\n\n```javascript\nvar viewport = require('electron-viewport')(deviceWidth, deviceHeight, true)\nvar mainWindow = viewport.getWindow()\n```\nCreates a scaled BrowserWindow which fits on screen, with device emulation enabled for the passed width and height.\n\n### Scaled window with options passed to BrowserWindow\n\n```javascript\nvar options = { frame: false } //specify your BrowserWindow options here, just an example\nvar viewport = require('electron-viewport')(width, height, options)\nvar mainWindow = viewport.getWindow()\n```\nCreates a scaled BrowserWindow which fits on screen, with the given [BrowserWindow options](https://github.com/electron/electron/blob/master/docs/api/browser-window.md) being passed\n\n### Scaled window with options and device emulation\n\n```javascript\nvar options = { frame: false } //specify your BrowserWindow options here, just an example\nvar viewport = require('electron-viewport')(width, height, true, options)\nvar mainWindow = viewport.getWindow()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienhoboken%2Felectron-viewport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falienhoboken%2Felectron-viewport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienhoboken%2Felectron-viewport/lists"}