2.1.1 • Published 3 years ago

tense-builder v2.1.1

Weekly downloads
13
License
ISC
Repository
-
Last release
3 years ago

Tests

Tense Builder

Instalation

npm i tense-builder -S

Usage

Parse mode

const TenseBuilder = require('tene-builder')
const tenseBuilder = new TenseBuilder()
tenseBuilder.config.space = '-'

const result = tenseBuilde.build('places-or-regions-with-hot-climate-and-low-racism-ubicated-in-romania-or-barcelona')

console.log(result)

// output is:
/*
[
    {
        word: 'places',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'regions',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'hot climate',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'low racism',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'romania',
        type: 'where',
        mood: 'or',
    },
    {
        word: 'barcelona',
        type: 'where',
        mood: 'or',
    },
]
*/

Build mode

const TenseBuilder = require('tene-builder')
const tenseBuilder = new TenseBuilder()

tenseBuilder.config.space = '-'

const parts = [
    {
        word: 'places',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'regions',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'hot climate',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'low racism',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'romania',
        type: 'where',
        mood: 'or',
    },
    {
        word: 'barcelona',
        type: 'where',
        mood: 'or',
    },
]

const result = tenseBuilde.build(parts)

console.log(result)
// output is: 
/*
    "places-or-regions-with-hot-climate-and-low-racism-ubicated-in-romania-or-barcelona"
*/

Types

"subject" your subject

"what" for stuff

"whatNegative" for negate stuff

"where" for ubications

Moods

"or" / "and"

2.1.1

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago