{"id":13798018,"url":"https://github.com/delvedor/electron-is","last_synced_at":"2025-04-05T18:08:21.813Z","repository":{"id":57221729,"uuid":"57110349","full_name":"delvedor/electron-is","owner":"delvedor","description":"An 'is' utility for Electron which provides a set of handy functions, with a self-descriptive name.","archived":false,"fork":false,"pushed_at":"2018-12-27T02:04:10.000Z","size":40,"stargazers_count":219,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T17:06:52.247Z","etag":null,"topics":["electron","utility"],"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/delvedor.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":"2016-04-26T08:14:25.000Z","updated_at":"2025-02-16T04:27:32.000Z","dependencies_parsed_at":"2022-08-29T02:12:53.980Z","dependency_job_id":null,"html_url":"https://github.com/delvedor/electron-is","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delvedor%2Felectron-is","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delvedor%2Felectron-is/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delvedor%2Felectron-is/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delvedor%2Felectron-is/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delvedor","download_url":"https://codeload.github.com/delvedor/electron-is/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378143,"owners_count":20929296,"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":["electron","utility"],"created_at":"2024-08-04T00:00:37.902Z","updated_at":"2025-04-05T18:08:21.792Z","avatar_url":"https://github.com/delvedor.png","language":"JavaScript","funding_links":[],"categories":["Library","JavaScript","Tools"],"sub_categories":["Check/Detect","For Electron"],"readme":"# electron-is\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/delvedor/electron-is.svg?branch=master)](https://travis-ci.org/delvedor/electron-is)\n\nAn 'is' utility for Electron.  \n`electron-is` provides a set of isomorphic 'is' APIs, that you can use it both in main and renderer process.  \nSee \u003ca href=\"#usage\"\u003eusage\u003c/a\u003e for more information.\n\n## Install\n```\n$ npm install electron-is --save\n```\n\n## API\n\n- **is.renderer()**  \nReturns `true` if you are calling the function from the renderer process.\n\n- **is.main()**  \nReturns `true` if you are calling the function from the main process.\n\n- **is.macOS()** *aliases* **is.osx()**  \nReturns `true` if your app is running under Mac OS.\n\n- **is.windows()**  \nReturns `true` if your app is running under Windows OS.\n\n- **is.linux()**  \nReturns `true` if your app is running under Linux OS.\n\n- **is.x86()**  \nReturns `true` if you the architecture of the processor is `ia32`.\n\n- **is.x64()**  \nReturns `true` if you the architecture of the processor is `x64`.\n\n- **is.production()**  \nReturns `true` if you are running the app in a `production` environment.\n\n- **is.dev()**  \nReturns `true` if you are running the app in a `dev` environment.\n\n- **is.sandbox()** *only* ***macOS***  \nReturns `true` if you are running the app in a `sandbox` environment under macOS.\n\n- **is.mas()**  \nReturns `true` if the app is running as a Mac App Store build.\n\n- **is.windowsStore()**  \nReturns `true` if the app is running as a Windows Store (appx) build.\n\n- **is.all(args)**  \nReturns `true` if all the 'is functions' passed as argument are true.  \nexample: `is.all(is.osx, is.x64)`\n\n- **is.none(args)**  \nReturns `true` if all the 'is functions' passed as argument are false.  \nexample: `is.none(is.windows, is.x86, is.main)`\n\n- **is.one(args)**  \nReturns `true` if one of the 'is functions' passed as argument is true.  \nexample: `is.one(is.osx, is.linux)`\n\n- **is.release(args)**  \nChecks the if the given release is the same of the OS (\\*)  \nexample: `is.release('10.0.10586')`\n\n- **is.gtRelease(args)**  \nChecks if the given release is greater than the current OS release (\\*)  \nexample: `is.gtRelease('10.9.5')`\n\n- **is.ltRelease(args)**  \nChecks if the given release is less than the current OS release (\\*)  \nexample: `is.ltRelease('6.3')`\n\nThe [Mac](https://en.wikipedia.org/wiki/Darwin_%28operating_system%29#Release_history) versions are mapped as `osx: darwin`, you must pass the *9.x.y* or *10.x.y* OSX version as argument and not the darwin version.  \nIf you are testing a [Windows](https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions) release you must pass the NT release, it can be *x.y* or *x.y.build* .\n\n\\* *Not implemented for Linux yet*\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n- In Main process:\n```javascript\n// es6\nimport is from 'electron-is'\n// es5\nconst is = require('electron-is')\nconsole.log(is.main())\n```\n- In Renderer process:\n```html\n\u003cscript\u003e\n    const is = require('electron-is')\n    console.log(is.renderer())\n\u003c/script\u003e\n```\n## Acknowledgements\n`electron-is` makes use of [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) package from [@sindresorhus](https://github.com/sindresorhus).\n\n## Contributing\nIf you feel you can help in any way, be it with examples, extra testing, or new features please open a pull request or open an issue.\n\nThe code follows the Standard code style.  \n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n______________________________________________________________________________________________________________________\n## License\n**[MIT](https://github.com/delvedor/electron-is/blob/master/LICENSE)**\n\n*The software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.*\n\nCopyright © 2016 Tomas Della Vedova\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelvedor%2Felectron-is","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelvedor%2Felectron-is","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelvedor%2Felectron-is/lists"}