GithubHelp home page GithubHelp logo

fz-property-file-reader's Introduction

Fz Property File Reader

This library using for access property file. You can read, write property file by using it.

Installation

You can install the fz-property-file-reader from npm by running.

npm install --save fz-property-file-reader

Usage

var propertyReader = require('fz-property-file-reader');

`Params -  property file's absolute path`

`Params type - key : string`

`Return - instance object`

`Return type - object`

var prop = propertyReader('sample.properties'); // for example

Methods

Get

Params - key

Params type - key : string

Return - value of your key

// Usage

prop.get(key);

If you pass the key to this method, it will returns the value to that key.

Set

Params - key, value

Params type - key : string, value : anything

Return - null

// Usage

prop.set(key, value);

Pass the key and value to this method, it will add your value with the key to properties file.

If your key already exists, it will throw key already exists error. At the time you will use update method instead of set. Because, you should not forget and change the existing keys.

Update

Params - key, value

Params type - key : string, value : anything

Return - null

// Usage

prop.update(key, value);

Pass the key and value to this method, it will update your value with the key to properties file.

If your key doesn't exists, it will throw key doesn't exists error. At the time you will use set method instead of update.

Has

Params - key

Params type - string

Return - ture or false

Return type - boolean

// Usage

prop.has(key);

Pass the key to this method, it will returns you key is there or not.

Remove

Params - key

Params type - string

Return - none

Return type - none

// Usage

prop.remove(key);

Pass the key to this method, it will remove value of key to your properties file. If there is no key, it will throws the key doesn't exists error.

GetAll

Params - none

Params type - none

Return - properties file as object

Return type - object

// Usage

prop.getAll();

Just call this method, it will returns object of your properties file.

GetKeys

Params - none

Params type - none

Return - keys of your properties file

Return type - array

// Usage

prop.getKeys();

Just call this method, it will returns array that has your properties file's keys.

Push

Params - none

Params type - none

Return - nothing

Return type - none

// Usage

prop.push();

Push method used to push your changes to your properties file. Just call this method, it will push your changes to your properties file.

GetRaw

Params - none

Params type - none

Return - raw data of your properties file

Return type - string

// Usage

prop.getRaw();

Just call this method, it will returns your properties file without parse.

Conclusion

If you find any errors in this, please let me know about it by using raise issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.