Socket
Book a DemoInstallSign in
Socket

tm-content-generator

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tm-content-generator

Content Generator

latest
npmnpm
Version
0.0.12
Version published
Weekly downloads
3
Maintainers
5
Weekly downloads
 
Created
Source

TM Content Generator

A content generator to be used in conjunction with Pravda

Build Status codecov

This is a content generator to be used with PRAVDA, which is a GraphQL API that interfaces with the Escenic's WebService.

Example usage

Below is a non-ES6 example that generates a news article:

'use strict';

var ContentGenerator = require('tm-content-generator').default;
var contentGenerator = new ContentGenerator();

// generate an article with only 1 picture inline relation and 1 html inline relation
var articleMeta = contentGenerator.generateArticle(
    { sectionId: 70, publication: 'mirror' },
    { picture: [1,2,3], html: [4,5] },
    { pictureRel: [], teaserRel: [], inlineRelations: ['picture','html'] },
    { min: 1, max: 1 }
);

Below is an ES6+ example that generates a news article:

import ContentGenerator from 'tm-content-generator';
const contentGenerator = ContentGenerator();

// generate an article with only 1 picture inline relation and 1 html inline relation
const articleMeta = contentGenerator.generateArticle(
    { sectionId: 70, publication: 'mirror' },
    { picture: [1,2,3], html: [4,5] },
    { pictureRel: [], teaserRel: [], inlineRelations: ['picture','html'] },
    { min: 1, max: 1 }
);

FAQs

Package last updated on 07 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts