# systemd-timedated-client

Latest version **1.0.1** (published 2018-02-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install systemd-timedated-client
pnpm add systemd-timedated-client
yarn add systemd-timedated-client
bun add systemd-timedated-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-02-09 |
| First published | 2018-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jeroen Vollenbrock |
| Maintainers | athombv |

## Links

- npm: https://www.npmjs.com/package/systemd-timedated-client
- npm.io page: https://npm.io/package/systemd-timedated-client

## Dependencies (1)

- [dbus-native](https://npm.io/package/dbus-native.md) 0.2.3

## Recent versions

- 1.0.1 (latest) — 2018-02-09
- 1.0.0 — 2018-02-02

## README

# systemd-timedated-client


*systemd-timedated-client* provides a client to access the systemd-timedated API.


## Install
    
Add the systemd-timedated-client module as dependency to your package.json and/or run npm install


## Library Usage
The API documentation can be found [here](https://athombv.github.io/node-systemd-timedated-client/TimeDateService.html).

```js
const service = new TimeDateService();

async function printData() {
    
    const [date, tz, canNtp, NTPenabled, NTPinSync] = 
        await Promise.all([
        service.getTime(),
        service.getTimezone(),
        service.getCanNTP(),
        service.getNTP(),
        service.getNTPSynchronized()
    ]);
    
    console.log('Date/time:', date.toLocaleString());
    console.log('Timezone:', tz);
    console.log('NTP available:', canNtp);
    console.log('NTP enabled:', NTPenabled);
    console.log('NTP in sync:', NTPinSync);
    console.log('');
}


async function test() { 
    
    service.on('timezoneChange', tz => console.log('new TZ:', tz));
    service.on('NTPChange', ntp => console.log('NTP state:', ntp));
    
    await service.connect();
    
    printData();
    
    await service.setTimezone('Europe/Amsterdam');
}

test();
```

---
_Source: https://npm.io/package/systemd-timedated-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
