How to use the cson.stringify function in cson

To help you get started, we’ve selected a few cson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poooi / poi / lib / config.es View on Github external
save = () => {
    try {
      fs.writeFileSync(configPath, CSON.stringify(this.configData, null, 2))
    } catch (e) {
      console.warn(e)
    }
  }
github bentonam / fakeit / app / output.js View on Github external
const format_data = (data) => new Promise((resolve, reject) => {
  try {
    if (settings.output === 'json') {
      resolve(JSON.stringify(data, null, settings.format));
    } else if (settings.output === 'yaml' || settings.output === 'yml') {
      resolve(yaml.stringify(data, settings.format));
    } else if (settings.output === 'cson') {
      resolve(cson.stringify(data, null, settings.format));
    }
  } catch (e) {
    reject(e);
  }
});
github poooi / poi / views / redux / info / quests.es View on Github external
export function saveQuestTracking(records) {
  const { activeQuests } = window.getStore('info.quests')
  const admiralId = window.getStore('info.basic.api_member_id')
  fileWriter.write(
    questTrackingPath(admiralId),
    CSON.stringify(processQuestRecords(records, activeQuests)),
  )
}
github TypeStrong / atom-typescript / scripts / grammar.ts View on Github external
function csonStringify(data) {
  return cson.stringify(data, null, "  ")
}
github any-json / any-json / lib / index.ts View on Github external
public async encode(value: any) {
    return cson.stringify(value, undefined, 2)
  }
github bentonam / fakeit / packages / fakeit-format-cson / src / index.js View on Github external
stringify (obj: Object, settings: Object = {}): Promise {
      const indent: number = ((settings.formats || {}).cson || {}).spacing || settings.spacing
      return Promise.resolve(cson.stringify(obj, null, indent))
    },
  })
github bentonam / fakeit / app / utils.js View on Github external
  stringify: (obj, indent = 2) => Promise.resolve(cson.stringify(obj, null, indent))
};

cson

CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.

Artistic-2.0
Latest version published 11 months ago

Package Health Score

64 / 100
Full package analysis