How to use quaff - 1 common examples

To help you get started, we’ve selected a few quaff 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 texastribune / newsapps-app-kit / gulpfile.babel.js View on Github external
import autoprefixer from 'autoprefixer-core';
import browserSync from 'browser-sync';
import del from 'del';
import nunjucks from 'nunjucks';
import map from 'vinyl-map';
import quaff from 'quaff';
import runSequence from 'run-sequence';
import yargs from 'yargs';

const $ = gulpLoadPlugins();
const args = yargs.argv;
const bs = browserSync.create();

const config = require('./config');

let data = quaff(config.dataFolder);

let basePath = args.production ? url.resolve('/', config.deploy.key) + '/' : '/';
data.PATH_PREFIX = basePath;

let fullPath = url.format({
  protocol: 'http',
  host: config.deploy.bucket,
  pathname: config.deploy.key
}) + '/';
data.PATH_FULL = fullPath;

let published_stories = data.metadata.storylist.filter((d) => d.published);
data.LATEST_STORY = published_stories[published_stories.length - 1];

let env = nunjucks.configure(config.templateFolder, {autoescape: false});

quaff

Collect JS/JSON/YAML/YML/CSV/TSV/ArchieML files from a source folder and convert them into a single object.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular quaff functions