1.2.4 • Published 7 months ago
lesscms v1.2.4
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
7 months ago
1.2.3
7 months ago
1.2.2
7 months ago
1.2.0
7 months ago
1.1.8
7 months ago
1.1.7
7 months ago
1.1.5
7 months ago
1.1.4
7 months ago
1.1.3
7 months ago
1.1.2
8 months ago
1.1.1
8 months ago
1.1.0
8 months ago
1.0.9
8 months ago
1.0.8
8 months ago
1.0.7
8 months ago
1.0.6
8 months ago
1.0.5
8 months ago
1.0.4
8 months ago
1.0.3
8 months ago
1.0.2
8 months ago
1.0.1
8 months ago
1.0.0
8 months ago