src/IpfsService.js
/**
    * Saves a string on IPFS 
    *
    * @param   {String}       stringData  string to be buffered and persisted on IPFS        
    * @returns {Promise<String,Error>}    A promise that resolves with the new data's location and rejects with an error                   
    */
Saves a string on IPFS
@param   {String}       stringData  string to be buffered and persisted on IPFS
@returns {Promise}    A promise that resolves with the new data's location and rejects with an error
Saves a string on IPFS @param { String } stringData string to be buffered and persisted on IPFS @returns { Promise } A promise that resolves with the new data ' s location and rejects with an error
saveData(stringData) {
        const data = Buffer.from(stringData)
        return new Promise((resolve, reject) => {
            this.ipfs.files.add(data, (err, cid) => {
                if(err) reject(err)
                else resolve(cid[0].path)
            })
        }) 
    }
saveData ( stringData ) { const data = Buffer . from ( stringData ) return new Promise ( ( resolve , reject ) => { this . ipfs . files . add ( data , ( err , cid ) => { if ( err ) reject ( err ) else resolve ( cid [ 0 ] . path ) } ) } ) }
Saves a string on IPFS
 @param   {String}       stringData  string to be buffered and persisted on IPFS
 @returns {Promise<String,Error>}    A promise that resolves with the new data's location and rejects with an error
Saves a string on IPFS @param { String } stringData string to be buffered and persisted on IPFS @returns { Promise<String Error > } A promise that resolves with the new data ' s location and rejects with an error