osx-defaults
Version:
Access to OS X defaults program via simple API.
42 lines (35 loc) • 840 B
JavaScript
;
const defaults = require('../');
console.log('------------------ Delete Async ------------------');
console.log(
'original fooColorVariant',
defaults.read({
isGlobalDomain: true,
key: 'fooColorVariant'
})
);
defaults.write({
isGlobalDomain: true,
key: 'hello',
valueType: defaults.STRING,
value: 'world'
});
defaults.delete({
isGlobalDomain: true,
key: 'hello'
}, function(error, status) {
if (error) throw error;
if (status) {
console.log('Deleted');
console.log(
'deleted hello',
defaults.read({
isGlobalDomain: true,
key: 'hello'
})
);
} else {
console.log('Error occurred');
}
});
console.log('------------------ Delete Async ------------------');