properties-to-yml
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Quality Gate Status

Maintainability Rating

Reliability Rating

Security Rating

Bugs

Vulnerabilities

Coverage

Pipeline

PropertiesToYml

Converts strings/files from the properties format to strings/files in the yaml format with a nice Fluent interface.

Quick start

  1. Add PropertiesToYml as a dependency of your project. It's as simple as:
npm i properties-to-yml
  1. Import the library
import { PropertiesToYml } from 'properties-to-yml';
  1. Start converting

Examples

String to string

const output = new PropertiesToYml()
    .fromString('server.port = 8080')
    .convert()
    .toString();

File to string

const output = new PropertiesToYml()
    .fromFile('/path/to/file.properties')
    .convert()
    .toString();

File to file

new PropertiesToYml()
    .fromFile('/path/to/file.properties')
    .convert()
    .toFile('/path/to/file.yml');

String to file

new PropertiesToYml()
    .fromString('server.port = 8080')
    .convert()
    .toFile('/path/to/file.yml');

White spaces

You can customize how many spaces must be used in the outputted yaml.

To do so, just call .spaces(N) before calling the convert() method.

Example:

new PropertiesToYml()
    .spaces(4)
    .fromFile('/path/to/file.properties')
    .convert()
    .toFile('/path/to/file.yml');

Develop

Write code and run tests against it with npm test

Package Sidebar

Install

npm i properties-to-yml

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

15.4 kB

Total Files

5

Last publish

Collaborators

  • fsorge