index.js
function (data) {
  var q = _q.defer();
  data = data.replace(/\'/g,"\\\'");
  data = data.replace(/\"/g,'\\\"');
  exec(`echo "${data}" | crontab -`, (err, stdout, stderr) => {
    if (err) q.reject(err);
    if(stdout)q.resolve(stdout);
    else q.resolve(stderr);
  });
  return q.promise;
}
function (data) {
  var q = _q.defer();
  data = data.replace(/\'/g,"\\\'");
  data = data.replace(/\"/g,'\\\"');
  exec(`echo "${data}" | crontab -`, (err, stdout, stderr) => {
    if (err) q.reject(err);
    if(stdout)q.resolve(stdout);
    else q.resolve(stderr);
  });
  return q.promise;
}
function ( data ) { var q = _q . defer ( ) ; data = data . replace ( / \' / g , "\\\'" ) ; data = data . replace ( / \" / g , '\\\"' ) ; exec ( ` ${ data } ` , ( err , stdout , stderr ) => { if ( err ) q . reject ( err ) ; if ( stdout ) q . resolve ( stdout ) ; else q . resolve ( stderr ) ; } ) ; return q . promise ; }
low level to replace functionality  after testing
low level to replace functionality after testing