1.2.4 • Published 2 years ago

lesscms v1.2.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

A library to interact with the the less cms system

Example

// Create a project config
const project = new Project("http://localhost:3000/", {
    project: "fcg1tvtmgfhE7XnMHzEZ",
    publicToken: "503de08d-558f-4720-830e-293ce2131cd9",    
})

const regions = await project.getRegions({
    countries: ["NO"]
    // languages: [NB]
})

// Gets all the regions with countries: NO
console.log(regions)

const products = project.getCollection("myProductCollection")

// Get all items
const sampleProducts = await products.getItems()

// Get only a single items if configured in the project schema
const sampleProductSingle = await products.getSingle()

// Return error if no items
if (!sampleProducts) throw new Error("No products")

for (const product of sampleProducts) {
    // Get prop in item
    const cost = await product.getContent("cost")

    // Console log content
    console.log(cost)
}
1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.0

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago