{"_id":"o9n","_rev":"9-c7a019001d49d16a2a2216f573ea9f23","name":"o9n","description":"A screen.orientation ponyfill 🖥","dist-tags":{"latest":"2.1.1"},"versions":{"1.0.0":{"name":"o9n","version":"1.0.0","description":"A screen.orientation ponyfill","main":"index.js","scripts":{"test":"karma start","build":"mkdir -p ./dist && node_modules/.bin/browserify ./index.js -s o9n -o ./dist/o9n.js"},"testling":{"browsers":["chrome/latest"],"files":"test/*.js"},"keywords":["screen","orientation","ponyfill","polyfill"],"author":{"name":"Christian Maniewski","email":"chmanie@fastmail.com"},"license":"MIT","devDependencies":{"browserify":"^11.2.0","karma":"^0.13.10","karma-browserify":"^4.4.0","karma-phantomjs-launcher":"^0.2.1","karma-tap":"^1.0.3","karma-tape-reporter":"^1.0.3","phantomjs":"^1.9.18","tape":"^4.2.1"},"dependencies":{"a-promise":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"gitHead":"0dd7fd14712ec26e13400a9830567a3a33c324e3","bugs":{"url":"https://github.com/chmanie/o9n/issues"},"homepage":"https://github.com/chmanie/o9n#readme","_id":"o9n@1.0.0","_shasum":"b47a5d11adbcc7c7e9968bec4b1150d4312142fa","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"chmanie","email":"chmanie@gmail.com"},"dist":{"shasum":"b47a5d11adbcc7c7e9968bec4b1150d4312142fa","tarball":"https://registry.npmjs.org/o9n/-/o9n-1.0.0.tgz","integrity":"sha512-XEy7WVYE9iuT2J4MZeKXaV43704L9ES64rxqOdpl1w0pBtlOirsyva9Yv40ocHunDT2g4yCmU8LAK+PF6K+cng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFD77Qu+aVOS1Q0RWJFfGbn4oExu510c9kc4tehLb0rAAiBUg1VYfkGLjG0N5FlU5qnJHKtbO4+ojSxhmjmsj+jCzg=="}]},"maintainers":[{"name":"chmanie","email":"chmanie@gmail.com"}],"directories":{}},"2.0.0":{"name":"o9n","version":"2.0.0","description":"A screen.orientation ponyfill 🖥","main":"index.js","scripts":{"test":"karma start","build":"mkdir -p ./dist && node_modules/.bin/browserify ./index.js -s o9n -o ./dist/o9n.js"},"testling":{"browsers":["chrome/latest"],"files":"test/*.js"},"keywords":["screen","orientation","ponyfill","polyfill"],"author":{"name":"Christian Maniewski","email":"chmanie@fastmail.com"},"license":"MIT","devDependencies":{"browserify":"^11.2.0","karma":"^0.13.10","karma-browserify":"^4.4.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-safari-launcher":"^1.0.0","karma-tap":"^1.0.3","karma-tape-reporter":"^1.0.3","phantomjs":"^1.9.18","tape":"^4.2.1"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"gitHead":"9e4833169b5581b59a03825fb28cccc516c77025","bugs":{"url":"https://github.com/chmanie/o9n/issues"},"homepage":"https://github.com/chmanie/o9n#readme","_id":"o9n@2.0.0","_shasum":"375d00bfb2e683f97434f0ccc263a1bf211cd43f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"chmanie","email":"chmanie@gmail.com"},"dist":{"shasum":"375d00bfb2e683f97434f0ccc263a1bf211cd43f","tarball":"https://registry.npmjs.org/o9n/-/o9n-2.0.0.tgz","integrity":"sha512-SeonOus1yLZDn7JrSqHTQtlPbvvce/MV2bIlHRAdUfOCWeqpqB08PkdfkFz/o4ysyJV1IIYM78Wso/56gWb1Xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8ql0SGF7Uln+OUPALMWm9uIxejpNDAO8+9HdcmXjkzAIhAMAwJJVAdjXcsJ8ttQ29L6WbpeiHtmnLr7rIm5DAJm3X"}]},"maintainers":[{"name":"chmanie","email":"chmanie@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/o9n-2.0.0.tgz_1499808920923_0.607674679486081"},"directories":{}},"2.0.1":{"name":"o9n","version":"2.0.1","description":"A screen.orientation ponyfill 🖥","main":"index.js","scripts":{"test":"karma start","build":"mkdir -p ./dist && node_modules/.bin/browserify ./index.js -s o9n -o ./dist/o9n.js"},"testling":{"browsers":["chrome/latest"],"files":"test/*.js"},"keywords":["screen","orientation","ponyfill","polyfill"],"author":{"name":"Christian Maniewski","email":"chmanie@fastmail.com"},"license":"MIT","devDependencies":{"browserify":"^11.2.0","karma":"^0.13.10","karma-browserify":"^4.4.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-safari-launcher":"^1.0.0","karma-tap":"^1.0.3","karma-tape-reporter":"^1.0.3","tape":"^4.2.1"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"gitHead":"c2fffd4e4c42c8a740580f9b51d79d94bae2ce70","bugs":{"url":"https://github.com/chmanie/o9n/issues"},"homepage":"https://github.com/chmanie/o9n#readme","_id":"o9n@2.0.1","_shasum":"54bf7bc86d7d3c0b5e572b4093021b25ba9f34bd","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"chmanie","email":"chmanie@gmail.com"},"dist":{"shasum":"54bf7bc86d7d3c0b5e572b4093021b25ba9f34bd","tarball":"https://registry.npmjs.org/o9n/-/o9n-2.0.1.tgz","integrity":"sha512-CRPnXKAY4AeKOVAj6toflk8HyZXd+n2qkBxUeZHacUA4bPbkdFXHA9Ma4O1z9mCk67cystnQvx/OB8B9NbuZKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1hqk+yr9rOuxHFgvl32klj5ao2E3rEw/9o9VhzdTb1AIhAJ48Vt03f71Zn7dRLOQsWslY/+cAX2xyMYheZSAUFVdr"}]},"maintainers":[{"name":"chmanie","email":"chmanie@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/o9n-2.0.1.tgz_1499811336510_0.5397485527209938"},"directories":{}},"2.1.0":{"name":"o9n","version":"2.1.0","description":"A screen.orientation ponyfill 🖥","main":"index.js","scripts":{"test":"karma start","build":"mkdir -p ./dist && node_modules/.bin/browserify ./index.js -s o9n -o ./dist/o9n.js"},"testling":{"browsers":["chrome/latest"],"files":"test/*.js"},"keywords":["screen","orientation","ponyfill","polyfill"],"author":{"name":"Christian Maniewski","email":"chmanie@fastmail.com"},"license":"MIT","devDependencies":{"browserify":"^11.2.0","karma":"^0.13.10","karma-browserify":"^4.4.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-safari-launcher":"^1.0.0","karma-tap":"^1.0.3","karma-tape-reporter":"^1.0.3","tape":"^4.2.1"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"gitHead":"edbdad820a24018dd3cfa5342aa9b34579c033ab","bugs":{"url":"https://github.com/chmanie/o9n/issues"},"homepage":"https://github.com/chmanie/o9n#readme","_id":"o9n@2.1.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Kvf4kB/XBctZwXKwjAmlPVhCqRywMFXl+o0dvhIc04A5gjWdTiQWYgy75vGXPRBxa9TrkWK6rhgtE+o4GnZTYQ==","shasum":"e4566cf95e5abefdd10dd2c2bc304f2d8ebf243c","tarball":"https://registry.npmjs.org/o9n/-/o9n-2.1.0.tgz","fileCount":8,"unpackedSize":18587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelKvxCRA9TVsSAnZWagAAv/EP/2V4bPEA6ZYRNlR0Su63\n17m/mEvCN/JMkmpqs9RoFg2cPZ26Z27cAWey5Q78yV23Gqokv7BRgvmyil6A\nmu5T/k75MQVf8EtJdZco9phMV56JTtM7ppyOJIlVR+96iSgITydy5/D3IxcP\n/j7gM2dj1ed0fUss/fIHaVgryPnBOgZa7roMiTkvnIDjKG8lWpqh7DuT1MdL\ni3nFuDmF/3lXTIBsTh+HfoN3rLeAxK2RbZoTFFKwmv19dr5PcZaw2/L/qYoG\nmGAH7Dy9ALo/2ocHPvey8gyiGyuTRkITtCZFnvVvaayvgZm6fjD+QZ94olAv\nQUUDgtOb/nLarFCtEnHBQVaoTjZ1w2Cj2FpP22g496gV955iOYOpezf2iBoJ\nTYWjuIhUY6dAnMDT5JiEiPBJhUwMprQiANew+gMxajev0iOShNNJsg8ahak1\nnpIL7BNBbTFR3VLwaaYJPBepCjqChtXKeRZISe8njUYAdbBEB+Yh3rTev/a0\nN+vRtp2i2XWxuWEtft89c+FSqoblUJu4muF5jFNofstf+wSEkryCzPCemutj\nEr6a64ue4+aRdsAM6xDbWzoyx0gzMs45772JeOOtGoAx/X2nPNpfnADxH7nQ\nFskwobnnd8fUQg5cqwprBqRev8N7ipVahLNjtdCaIaD/gCFMGPmKill/Fo8B\n3okJ\r\n=MkC3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKcq9+17U8EENldCmQDVj2Tj9wka6biIaOsjg4Z2z/qwIgEh0qSGhNtYRy0z309U9YQV+oAyhoY/m6NXL/hQ/JjAs="}]},"maintainers":[{"name":"chmanie","email":"chmanie@gmail.com"}],"_npmUser":{"name":"chmanie","email":"code@chmanie.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/o9n_2.1.0_1586801648986_0.3683427789889422"},"_hasShrinkwrap":false},"2.1.1":{"name":"o9n","version":"2.1.1","description":"A screen.orientation ponyfill 🖥","main":"index.js","scripts":{"test":"npm run lint && karma start","build":"mkdir -p ./dist && browserify ./index.js -s o9n -o ./dist/o9n.js","lint":"eslint './**/*.js'","format":"eslint --fix './**/*.js'"},"testling":{"browsers":["chrome/latest"],"files":"test/*.js"},"keywords":["screen","orientation","ponyfill","polyfill"],"author":{"name":"Christian Maniewski","email":"code@chmanie.com"},"license":"MIT","devDependencies":{"browserify":"^11.2.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","husky":"^4.2.5","karma":"^0.13.10","karma-browserify":"^4.4.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-safari-launcher":"^1.0.0","karma-tap":"^1.0.3","karma-tape-reporter":"^1.0.3","lint-staged":"^10.1.3","prettier":"^2.0.5","tape":"^4.2.1"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js}":["eslint --fix"]},"gitHead":"f0da290b13214330c29de28e489baf28f189ca51","bugs":{"url":"https://github.com/chmanie/o9n/issues"},"homepage":"https://github.com/chmanie/o9n#readme","_id":"o9n@2.1.1","_nodeVersion":"17.2.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-R6NCwtdFWAOXE5JE/FUF4ZX4akpXdOrGH7K3cDf5tbNtpY1x9r7Lo+n7rwcr+8e5B67dN0aVw3Yu+CCpo5lZFw==","shasum":"ef172b692405f748e2d55ec94b12cadbb94db0de","tarball":"https://registry.npmjs.org/o9n/-/o9n-2.1.1.tgz","fileCount":10,"unpackedSize":17352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuPanCRA9TVsSAnZWagAAKTEQAIlXpRlWRT995TKuQWJ2\nCnLbIGekUM8XVJ95RSuO9I+ckZlWQZukIhoijntoO6GRewnWgUvbGYf38U7I\nglK5PO9/E+qIg5jYeO6xtWmrfCI8eE8G4XbmQmZNkcSzNcVFBeqZyXZub6QE\nHvLI7mOFKLZaL8gvPZnoanCKOwAd/ybWXyQzM9Ynccp/d34lLR3muWLFICBc\n3GfJlGFCkCW8yeSvhx81WcUJo/R9qTJaf00Pxh6KK2bO1sVNj2sAZbYPk/gO\ngvmtYjLbkcqSbBxpLi0QVg2scohPiSGL+fGf0dZxIL/M5d3GuQKVBHh0CFRr\n5sEgpn3XoqKkZCDCKJcoq/bGi5/9Z1p9JmVzfeKYHVK3uVGEdqlnksqm7e17\nh+ajVrGQF4XoBlPFhaGXCBPXGk+CImlT1BpPbXxMOUWjaRZfLy3yaV8T6Mgg\nG4kXJcbqMnjY5DcHWfob9TW3AMczLJ0jhRkiqj2Hwdm6NIP8LGPX5911lU3k\nSkJitMW6utIeqj6NIa7Ud8jepID/UgGtXnJLwbjTpCNhaf2AMJ7VVdG14xE6\n62xdI3ZbuLqxUrCmTGnkv6Gyp6yWsD1CHNPYUJVQO9GkUiX1qXQWWvSpSQdi\neFRSBUytke0Tcb4IR6l74gUrWOxtrLltwTYgXSAMxdA97lP/8Zd2PMH6luMQ\nZBc/\r\n=TZdg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2Gu26L5vOOqsxV9O+ZVSsDOuS/Zcp1Bnqt3dK+IMkYwIhAJQ33dLzlD307XDuwddIfTf2aYCwbLC8lZ2pYYqcAoRA"}]},"_npmUser":{"name":"chmanie","email":"code@chmanie.com"},"directories":{},"maintainers":[{"name":"chmanie","email":"code@chmanie.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/o9n_2.1.1_1639511719105_0.4060769181917383"},"_hasShrinkwrap":false}},"readme":"# o9n (orientation)\nA screen.orientation ponyfill 🖥\n\nThis is a [ponyfill](https://ponyfill.com) for the new, currently in-draft [screen.orientation API](https://w3c.github.io/screen-orientation/#widl-ScreenOrientation-lock-Promise-void--OrientationLockType-orientation).\n\n## Installation\n\nUse [npm](https://npmjs.org):\n\n```\nnpm install o9n\n```\n\n## Usage\n\nUsing [browserify](https://github.com/substack/node-browserify):\n\n```javascript\nvar orientation = require('o9n').orientation;\n```\n\nor build it and include the file in a `<script>`-tag:\n\n```html\n<script src=\"dist/o9n.js\"></script>\n```\n\nIt will be available in `window.o9n`.\n\n### SSR Usage\n\nIf you're in an environment where `window` may be undefined like during an SSR, you're able to call the included `getOrientation` method when `window` _is_ defined in order to get the same `orientation` object\n\n```javascript\nvar getOrientation = require('o9n').getOrientation;\nvar orientation = getOrientation();\n```\n\n## Supported browsers\n\nIt **should** work in these browsers although I couldn't test them all manually (or automatically).\n\n* IE10+\n* Edge 12+\n* Firefox 6+\n* Safari 6+\n* Chrome 9+\n* Opera 15+\n* iOS Safari 5.1+\n* Android browser 3+\n* Blackberry browser 10+\n* Opera mobile 30+\n* Chrome for Android (some versions ago)\n* Firefox for Android (some versions ago)\n* IE Mobile 10+\n\n## Building\n\n```\nnpm run build\n```\n\ncreates `o9n.js` in the *dist* dir\n\n## Implementation\n\nThis ponyfill leverages all the browser APIs there are at the moment:\n\nMethods:\n* `screen.msLockOrientation` (IE11, Win8.1, Edge 12+)\n* `screen.msUnlockOrientation` (IE11, Win8.1, Edge 12+)\n* `screen.mozLockOrientation` (Firefox 18+)\n* `screen.mozUnlockOrientation` (Firefox 18+)\n\nEvents:\n* `window.onorientationchange` (iOS)\n* `screen.onmsorientationchange` (IE11, Win8.1, Edge 12+)\n* `screen.onmozorientationchange` (Firefox 18+)\n\nGetters:\n* `window.orientation` (iOS)\n* `screen.msOrientation` (IE11, Win8.1, Edge 12+)\n* `screen.mozOrientation` (Firefox 18+)\n\n\nIt normalises them to the aforementioned API draft which is implemented in Chrome 38+, Opera 25+. Also it falls back to a media-query solution for browsers that don't support orientation events at all (all that were not mentioned yet).\n\n## API\n\n### Methods\n\n### o9n.orientation.lock()\n\nLocks the orientation on devices that support it. Possible values are:\n\n* `any`\n* `natural`\n* `landscape`\n* `portrait`\n* `portrait-primary`\n* `portrait-secondary`\n* `landscape-primary`\n* `landscape-secondary`\n\nIt returns a **promise** which resolves, when the orientation was locked. The promise will be rejected if the device could not be locked or locking is not supported at all.\n\n### o9n.orientation.unlock()\n\nUnlocks the orientation on devices that support it. Returns **undefined**.\n\n### Events\n\n#### 'change' on o9n.orientation\n\n`o9n.orientation` can listen to the `change` event that fires every time the orientation was changed. Just use `o9n.orientation.addEventListener` or `o9n.orientation.onchange` like you would normally do.\n\n### Getters\n\n#### o9n.orientation.type\n\nEquals to one of the following\n\n* `portrait-primary`\n* `portrait-secondary` (portrait upside down)\n* `landscape-primary`\n* `landscape-secondary` (landscape upside down)\n\n#### o9n.orientation.angle\n\nCurrently equals to 0 for browsers that don't support it.\n\n## Polyfill (not recommended)\n\nIt is also possible to install o9n as a polyfill. Just call\n\n`o9n.install();`\n\nbefore using any of the orientation API.\n\nIt will be then available as `window.screen.orientation`.\n\nThis implementation already differs a bit from the current browser implementation in Blink. So it is not recommended to use it as a polyfill to not confuse tools like Modernizr.\n\n## Running the tests\n\n```\nnpm test\n```\n\n## Contributing\n\nI'm happy for every contribution or manual tests in browsers I could not test. Just open an issue or directly file a PR.\n\n## License\n\nMIT\n","maintainers":[{"name":"chmanie","email":"code@chmanie.com"}],"time":{"modified":"2022-06-22T15:18:37.884Z","created":"2015-10-07T16:13:23.371Z","1.0.0":"2015-10-07T16:13:23.371Z","2.0.0":"2017-07-11T21:35:21.951Z","2.0.1":"2017-07-11T22:15:37.476Z","2.1.0":"2020-04-13T18:14:09.106Z","2.1.1":"2021-12-14T19:55:19.281Z"},"homepage":"https://github.com/chmanie/o9n#readme","keywords":["screen","orientation","ponyfill","polyfill"],"repository":{"type":"git","url":"git+https://github.com/chmanie/o9n.git"},"author":{"name":"Christian Maniewski","email":"code@chmanie.com"},"bugs":{"url":"https://github.com/chmanie/o9n/issues"},"license":"MIT","readmeFilename":"Readme.md","users":{"adrian.arroyocalle":true}}