Socket
Socket
Sign inDemoInstall

@ewizardjs/banner-structure-api

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewizardjs/banner-structure-api

Banner structure api


Version published
Weekly downloads
9
decreased by-57.14%
Maintainers
7
Weekly downloads
 
Created
Source

BANNER STRUCTURE API

Banner structure api is a set of methods that will simplify working with banner array and banners structure.

Install banner-structure-api with npm

  npm i @ewizardjs/banner-structure-api

Usage/Examples

In your ".ts"/".js" files:

import {
  getBanners,
  makeStructure,
} from '@ewizardjs/banner-structure-api';  
  
const structure = readJson('./structure.json');  
  
const bannersArray = getBanners(structure);  
const structureJson = makeStructure(bannersArray);  

Available Interfaces / Types / etc

NameFieldsDescription
Bannerid, name, size, template, thumbnailThe main fields of each banner
BannerSizewidth, height, dprDimensions of each banner
BannersJsonbannersJson file format with banners

Description of banner fields

NameDescriptionRequired field in json
idBanner idYes
nameBanner nameYes
sizeBanner size. Has type BannerSizeYes
templatePath to the banner templateNo
thumbnailPath to the banner thumbnailNo
widthBanner widthYes
heightBanner heightYes
dprDevice pixel ratioYes

API Reference

MethodArgumentsExecution resultDescription
getBannersbannersJson[, options]An array of Banner type objectsGet information about all banners
makeStructurebannersArrayJSON of type BannersJsonGet new structure json from banners array

Arguments of the methods

NameDescription
bannersJsonstructure.json file content
optionsA set of options. May include systemSettings and callback fields
bannersArrayAn array of banners
systemSettingsFragment of the default paths object. Necessary for forming paths to the template and thumbnails in the banner type structures. Can be obtained from the "@ewizardjs/system-settings" module.

FAQs

Package last updated on 14 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc