3.4.5 • Published 5 years ago

ts-zone-file v3.4.5

Weekly downloads
2
License
ISC
Repository
gitlab
Last release
5 years ago

TS-Zone-file

This module is designed for manaing a BIND name server.

Written in typescript and compiled to pure javascript. No extrernal dependencies Full Examples can be found in the git repo.

It takes inspiration from zone-file

Usage

Parsing zonefile

Loading

import { parseZoneFile } from 'ts-zone-file';
import { readFile } from 'fs-extras'
const file = await readFile('/zones/example.com');
const zone = await parseZoneFile(file.toString())

Appending

import { parseZoneFile } from 'ts-zone-file';
import { readFile, writeFile } from 'fs-extras'
const file = await readFile('/zones/example.com');
const zone = await parseZoneFile(zoneFileString.toString())
zone.a.push({ host: 'www', value: '1.1.1.1' })
const zoneString = await generateZoneFile(zone)
await writeFile('./example.com', zoneString)

Creating Zonefile Text

import { generateZoneFile } from 'ts-zone-file';
import { writeFile } from 'fs-extras'
const string = await generateZoneFile(zone);
await writeFile('/zones/example.com', string)

Parse named.conf

import { parseBINDConfig } from 'ts-zone-file';
import { readFile } from 'fs-extras'
const file = await readFile('/named.conf');
const zone = await parseBINDConfig(file.toString())

Generate named.conf

import { generateConfig } from 'ts-zone-file';
import { writeFile } from 'fs-extras'
const string = await generateConfig(SAMPLE2OBJ)
await writeFile('/named.conf', string)
3.4.5

5 years ago

3.4.4

5 years ago

3.4.3

5 years ago

3.4.2

5 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago