Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsejcksn/tmutil-status
Get macOS Time Machine status as a JS object
https://github.com/jsejcksn/tmutil-status
Last synced: about 22 hours ago
JSON representation
Get macOS Time Machine status as a JS object
- Host: GitHub
- URL: https://github.com/jsejcksn/tmutil-status
- Owner: jsejcksn
- License: mit
- Created: 2019-12-11T03:36:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T21:16:36.000Z (over 1 year ago)
- Last Synced: 2024-11-02T11:12:43.098Z (14 days ago)
- Language: JavaScript
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tmutil-status
Get macOS Time Machine status as a JS object## About
In macOS, the terminal command
```
tmutil status
```will display the current status of Time Machine in the [NextSTEP property list dictionary format](https://en.wikipedia.org/wiki/Property_list#NeXTSTEP). (See also: [Time Machine progress from the command line](https://apple.stackexchange.com/questions/162464/time-machine-progress-from-the-command-line).)
This package provides that information as a JavaScript object.
## Install
```
npm install tmutil-status
```## Use
### ESM import
```js
import tmutilStatus from 'tmutil-status';
```### CommonJS import
```js
const tmutilStatus = require('tmutil-status/commonjs');
```### Promise use
```js
// async/await
(async () => {
try {
const data = await tmutilStatus();
console.log(data);
}
catch (err) {
console.error(err);
}
})();// chaining
tmutilStatus()
.then(data => console.log(data))
.catch(err => console.error(err));
```### Callback use
```js
tmutilStatus((err, data) => {
if (err) console.error(err);
else console.log(data);
});
```