npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

betterlogiclibrary

v0.10.2

Published

The Better Logic Library for Athom's Homey

Downloads

103

Readme

If you are a User and want to know more about how to use the new BLL coding, goto the [APP][Pro] Better Logic Library - For Users Forum Topic.

If you are a App Developer and want to know more about how to include this into your App or how to let your App support BLL coding, goto the [APP][Pro] Better Logic Library - For Developers Forum Topic.

Part of: Better Logic Library - Just some better logic, variable and library management

Homey's first real Library: Better Logic Library!

The Better Logic App has a new addition: Libraries and a library management for other apps to consume.

The new Decoder

BLL now has new expression cards, but also a new coding for text arguments within flowcards. For instance, when you place this within a textargument: Hello, today is {[date("dddd")]}, BLL will automaticly find those expressions within the texts and decode them, resulting in - Hello, today is monday - .

Users currently have access to lodash, mathjs, basic javascript methods and customisable methods through the BLL App Settings. But also the custom DateTime and Number module. A user can for instance use this within the Save Image Token flowcard from the FTP Client App. image|325x88 This image will be saved with the custom timestamp the user writes himself.

Users can also add there own custom functions within the Better Logic App Settings, which they then can use in all Apps, yours too!

NPM modules can be loaded from BLL, which reduces the installation time and size of your App.

Currenty you can load the next NPM's

  • math.js 11.3.3
  • lodash 4.17.21.

Basis for your settings

Currently you can reference to the next files in Settings or (Re)Pair screens:

  • Bootstrap 5.2.2 ../net.i-dev.betterlogic/assets/css/bootstrap.min.css ../net.i-dev.betterlogic/assets/js/bootstrap.bundle.min.js
  • Font Awesome (Solid and Regular) 6.2.0 ../net.i-dev.betterlogic/assets/css/fontawesome.min.css ../net.i-dev.betterlogic/assets/js/fontawesome.min.js
  • jQuery UI ../net.i-dev.betterlogic/assets/js/jquery-ui.min.js ../net.i-dev.betterlogic/assets/css/jquery-ui.css
    • jQuery UI Touch-Punch, include this for 'clicks" on mobiles, adjusted for Homey. ../net.i-dev.betterlogic/assets/js/jquery-ui.touch-punch.min.js
  • Lodash 4.17.21. ../net.i-dev.betterlogic/assets/js/lodash.min.js
  • AngularJS 1.8.2 ../net.i-dev.betterlogic/assets/js/angular.min.js
    • Drag-and-drop 1.0.3 angularjs (Customized for Homey ) ../net.i-dev.betterlogic/assets/js/angular-dragdrop.js
    • Smart Table angularjs ../net.i-dev.betterlogic/assets/js/smart-table.min.js ../net.i-dev.betterlogic/assets/css/smart-table.css

How to include into your App?

The Basic

These are just a few simple steps to start with the most basic: include the BLL and initialize it:

  • Add BLL through NPM. npm install betterlogiclibrary
  • Add the permission to your app.json "permissions": ["homey:app:net.i-dev.betterlogic"]
  • Import the BL module in the app.js:. const { BL } = require('betterlogiclibrary');
  • Initialize the BL in the app.js onInit: await BL.init({homey:this.homey});

There will be no error's thrown if BLL is not installed or not available, if no modules are used, it is put on silent mode. Making it not required, but a bonus for users who wish to use BLL coding: If your app supports it, they just need to install BLL (which they already will have i guess).

Decoder

Now, to use the decoder, you do not need any modules loaded. The texts will be decoded by the BLL App, so you do not need to include math.js or lodash into your app to support decoding.

All you need to do, is run the text you wish to decode through the decoder:

  • Import the BL module. const { BL } = require('betterlogiclibrary');
  • Use it! Here is an path argument that i want to have decoded: args.path = await BL.decode(args.path);

That's it!

Including modules

To include modules like lodash, follow these steps:

  • Include the module(s) in the BL initialization:
let bl = await new BL({
  homey:this.homey, 
  modules:[
    "_",
    "math",
    "datetime"
]});
  • Now you can use it anywhere: BL._.find BL._.pickBy BL.datetime.toString('dd-MM-yyyy') BL.datetime.toString('dddd') = monday

How does it work?

The BLL loader loads modules through the BLL Api. This massively reduces the app install size. Only requested modules are loaded and the Static BL is generated. Every time the BLL get's an update or is installed, all updated files and modules will be reloaded into your app. Your app doesn't even need a restart for this!