Alinex Format: Readme
This package will give you an easy way to serialize and deserialize different data objects into multiple formats.
The major features are:
- easy to use
- load format libraries on demand
- auto detection
It is one of the modules of the Alinex Namespace following the code standards defined in the General Docs.
Read the complete documentation under https://alinex.github.io/node-format.
Install
The easiest way is to let npm add the module directly to your modules (from within you node modules directory):
Shell Script npm install alinex-format --save
And update it to the latest version later:
Shell Script npm update alinex-format --save
Always have a look at the latest changes.
Usage
To use the format you have to load the module first:
CoffeeScript Code format = require 'alinex-format'
This gives you back the main format instance which holds two methods to use:
stringify
Serialize data object into string.
Arguments:
obj
object to be formattedformat
format to use or filename to read format fromoptions
(optional) specific for the formatcb
callback will be called with (err, text)
parse
Try to parse object from string. Auto detect if no format is given.
Arguments:
string
text to be parsedformat
(optional) format to use or filename to read format fromcb
callback will be called with (err, object)
License
© Copyright 2016 Alexander Schilling
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.