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

@livinglogic/livingsdk

v0.0.1

Published

A package for using LivingApps as Backend for your nodejs or browser javascript applications. It enables you to login users, download App data, create/update/delete records.

Downloads

6

Readme

LivingSDK

A package for using LivingApps as Backend for your nodejs or browser javascript applications. It enables you to login users, download App data, create/update/delete records.

Warning: The SDK is in alpha stage. So we do not recommend to use the SDK for production projects.

Usage:

First we need to install and import

$ npm i @livinglogic/livingsdk
// import LivingSDK class
import { LivingSDK } from '@livinglogic/livingsdk';
// login your user (not always required)
const lsdk = new LivingSDK({}, yourUsername, yourPassword);

When you have authenticated the user, you can download data from LivingApps.

lsdk.get(appId)
	.then((LAAPI: LAAPI) => {
        return LAAPI;
    })

After downloading the LivingApps App data you can update the downloaded records (you can filter with your LivingApps view vemplate, so you do not need to download all records).

// download app data
lsdk.get(lsd.appId, lsdktemplates.admin)
	.then((LAAPI: LAAPI) => {
        // select app
		return LAAPI.get('datasources').get('self').app;
	})
	.then((storage: any) => {
        const arr: Promise<any>[] = [];
            // iterate through records and update them
			storage.records.forEach((record: any) => {
				arr.push(record.sdkupdate({
					text: '[JS] this is a updated text',
					number: 84,
					phone: '+49 0000 0000000001',
					url: 'https://dev.milleniumfrog.de',
					mail: '[email protected]',
					date: new Date(),
					textarea: '[JS] this is an even more updatetext',
					selection: 'option_2',
					options: '_3',
					multiple_options: ['_2'],
					checkmark: true,
					geodata: '0.1,1.0,'
				}));
			});
			return Promise.all(arr);
	});

Very similar to updating is inserting and removing records.

// download app data
lsdk.get(appId)
	.then((LAAPI: LAAPI) => {
        //  get datasource
		return LAAPI.get('datasources').get('self');
	})
	.then((storage: any) => {
        // select app and insert record to app
		return storage.app.sdkinsert({
			text: '[JS] this is a text',
			number: 42,
			phone: '+49 0000 0000000000',
			url: 'https://milleniumfrog.de',
			mail: '[email protected]',
			date: new Date(),
			textarea: '[JS] this is even more text',
			selection: 'option_1',
			options: '_1',
			multiple_options: ['_1'],
			checkmark: true,
			geodata: '0.0,0.0,'
		});
    });

// download app data
lsdk.get(lsd.appId, lsdktemplates.admin)
	.then((LAAPI: LAAPI) => {
        // select
		return LAAPI.get('datasources').get('self').app;
	})
	.then((storage: any) => {
        const arr: Promise<any>[] = [];
        // iterate through records and delete them from livingapps
		storage.records.forEach((rec: any) => {
			arr.push(rec.sdkdelete());
		})
		return Promise.all(arr);
	})

DONTS

  • do not use record.update and record.insert, use record.sdkupdate and record.insert instead.
  • do not login for each request, even when we do that in the tests. When you do that your requests need 1 second more per request. Create a global LivingSDK instance and use her until you need to reauthenticate.

known Limitations:

  • can not upload file fields

Authors:

  • René Schwarzinger (livingsdk, livingapi injections, tests)
  • Walter Dörwald (livingapi)