Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syroegkin/nxtp-js
The JavaScript implementation of the nxtp (time server for zx-spectrum next)
https://github.com/syroegkin/nxtp-js
javascript nxtp speccy spectrum-next timeserver zx-spectrum zx-spectrum-next
Last synced: about 1 month ago
JSON representation
The JavaScript implementation of the nxtp (time server for zx-spectrum next)
- Host: GitHub
- URL: https://github.com/syroegkin/nxtp-js
- Owner: syroegkin
- License: gpl-3.0
- Created: 2023-04-26T19:36:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-28T22:24:56.000Z (about 2 months ago)
- Last Synced: 2024-10-28T22:25:30.030Z (about 2 months ago)
- Topics: javascript, nxtp, speccy, spectrum-next, timeserver, zx-spectrum, zx-spectrum-next
- Language: TypeScript
- Homepage:
- Size: 349 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nxtp-js
nxtp-js is a JavaScript implementation of the nxtp library, developed for the ZX Spectrum Next computer. It provides a convenient method for configuring the local time on vintage computers that possess both a Real Time Clock (RTC) and a network interface.
This library is inspired by the original [nxtp](https://github.com/Threetwosevensixseven/nxtp) project for the ZX Spectrum Next.
## Installation
To use this project, you need to have Node.js version 18 or higher installed. As an alternative you can use nvm.
```shell
git clone https://github.com/syroegkin/nxtp-js.git
nvm use # if you use nvm
npm install
npm run build
npm start
```By default, the library listens on port 12300. However, you can configure a different port by setting the environment variable **PORT**:
```shell
PORT=12500 npm start
```Alternatively you can use provided docker-compose file:
```shell
docker-compose up -d
```There is an available pre-built Docker image that you can utilize:
```shell
docker pull ghcr.io/syroegkin/nxtp-js:latest
```Docker-compose uses this pre-built image by default, but if you wish, you can build it by yourself:
* Open docker-compose.yml.
* Comment out the image: line.
* Uncomment the build: line.The public time server is available at
* http://time.zx.in.net:12300
* http://time1.zx.in.net:12300On your ZX Spectrum Nextr, you have the option to configure fallback servers. In the event that one server is unavailable, the system will automatically attempt to switch to a backup server.
Your `autoexec.bas` file may look like this:
```basic
5 REM First server
10 ON ERROR GO TO 50
20 .nxtp time.zx.in.net 12300 -z=W.EuropeStandardTime
30 ON ERROR
40 GO TO 140
45 REM Second server
50 ON ERROR GO TO 90
55 PAUSE 100
60 .nxtp time.nxtel.org 12300 -z=W.EuropeStandardTime
70 ON ERROR
80 GO TO 140
85 REM Third server
90 ON ERROR GO TO 130
95 PAUSE 100
100 .nxtp time1.zx.in.net 12300 -z=W.EuropeStandardTime
110 ON ERROR
120 GO TO 140
130 PRINT: PRINT "Can not fetch time"
140 REM the rest of the code goes here...
9997 GO TO 9999
9998 SAVE "c:/nextzxos/autoexec.bas" LINE 0
9999 ERASE```
ZX Spectrum Next is a trademark of SpecNext Ltd.