How to use the macos-version.assertGreaterThanOrEqualTo function in macos-version

To help you get started, we’ve selected a few macos-version examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JXA-userland / JXA / packages / @jxa / run / src / run.ts View on Github external
return new Promise((resolve, reject) => {
        macosVersion.assertGreaterThanOrEqualTo("10.10");
        const child = execFile(
            "/usr/bin/osascript",
            ["-l", "JavaScript"],
            {
                env: {
                    OSA_ARGS: JSON.stringify(args)
                },
                maxBuffer: DEFAULT_MAX_BUFFER
            },
            (err: Error, stdout: any, stderr: any) => {
                if (err) {
                    return reject(err);
                }

                if (stderr) {
                    console.error(stderr);
github sindresorhus / touch-bar / cli.js View on Github external
#!/usr/bin/env node
'use strict';
const path = require('path');
const meow = require('meow');
const execa = require('execa');
const macosVersion = require('macos-version');

macosVersion.assertGreaterThanOrEqualTo('10.14');

meow(`
	Example
	  $ touch-bar
`);

const appPath = path.resolve(__dirname, 'vendor/Touch Bar Simulator.app');

execa('open', ['-a', appPath]);
github sindresorhus / run-jxa / index.js View on Github external
module.exports = async (input, arguments_) => {
	macosVersion.assertGreaterThanOrEqualTo('10.10');
	const {stderr} = await execa('osascript', commandArguments, prepareOptions(input, arguments_));
	return handleOutput(stderr);
};
github sindresorhus / node-is-camera-on / index.js View on Github external
module.exports = async () => {
	macosVersion.assertGreaterThanOrEqualTo('10.11');
	return (await execa.stdout(bin)) === 'true';
};

macos-version

Get or check the current macOS version

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis