...
Table of Contents | ||
---|---|---|
|
dataforge
The dataforge library can load CSV, JSON, or arbitrary data sets; dataforge lets you analyze data, wrangle, and visualize with ease. See https://www.npmjs.com/package/data-forge.
...
Code Block |
---|
const dataForge = require('dataforge'); dataForge.readFile('./input-data-file.csv') // Read CSV file (or JSON!) .parseCSV() .parseDates(["Column B"]) // Parse date columns. .parseInts(["Column B", "Column C"]) // Parse integer columsn. .parseFloats(["Column D", "Column E"]) // Parse float columns. .dropSeries(["Column F"]) // Drop certain columns. .where(row => predicate(row)) // Filter rows. .select(row => transform(row)) // Transform the data. .asCSV() .writeFile("./output-data-file.csv") // Write to output CSV file (or JSON!) .then(() => { console.log("Done!"); }) .catch(err => { console.log("An error occurred!"); }); |
handlebars
The handlebars library lets you build semantic templates effectively with no frustration. The handlebars library is compatible with mustache templates. In most cases, you can swap out the mustache with handlebars and continue using your current templates. See https://www.npmjs.com/package/handlebars.
...
Code Block |
---|
Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids: Jimmy is 12 Sally is 4 |
lodash
The lodash library makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, and so on. See https://lodash.com/docs/4.17.10.
...
Code Block |
---|
var _ = global.get('lodash'); _.forEach([1, 2], function(value) { node.warn(value); }); |
moment
Themoment library makes it easier to use parse, validate, manipulate, and display dates and times in JavaScript. See https://momentjs.com/.
...
Code Block |
---|
var moment = global.get('moment'); var newDate = moment().add(#, 'days'); |
momentTimezone
The momentTimezone library makes it easier to parse and display dates in any time zones. See https://momentjs.com/timezone/.
...
Code Block |
---|
var momentTz = global.get('momentTimezone'); var moment = global.get('moment'); var newyorkTime = momentTz(moment()).tz('America/New_York').format(); |
orbitaUtil
The orbitaUtil library contains all reusable codes that are frequently used in the Experience Designer and Experience Manager.
...
Code Block |
---|
var orbitaUtil = global.get('orbitaUtil') var options = { text: textResponse }; textResponse = orbitaUtil.OESanitizeSimpleHtmlText(options); |
cryptoJS
The cryptoJS module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. Using cryptoJS, you can send the encrypted data to the server. See https://www.npmjs.com/package/crypto-js and https://cryptojs.gitbook.io/docs/.
...
Code Block |
---|
enValue: "270ba1458e8d5307e773e3c17f725d7f1606f37d" |
zipcodeToTimezone
The zipcodeToTimezone module converts Zipcode data to the corresponding Timezone. See https://www.npmjs.com/package/zipcode-to-timezone.
...
Code Block |
---|
America/Los_Angeles |
Related Articles
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|