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

@swyger/client

v0.1.13

Published

Swyger Client JS library is used for Swyger Server as consumer Rest API(authentication,CRUD, Storage...)! Visit the master branch: https://github.com/coorise/swyger-js-client.git

Downloads

22

Readme

Swyger Client JS

Get Started

Swyger Client is used for Swyger Server as consumer Rest API. Visit the master branch: https://github.com/coorise/swyger-js-client.git

You can download the swyger database client js library on: https://www.unpkg.com/@swyger/client

then save it somewhere in your directory like "/dist/swyger-client.min.js"

<script type="module">
        import SwygerClient from './dist/swyger-client.min.js'
        //import SwygerStorageClient from '@swyger/client' //with npm for node module

        let config={
            //Configure the offline DB
            OFFLINE_DB_NAME:{
                AUTH:'swyger_auth',
                DATABASE:'swyger_database',
                STORAGE:'swyger_storage'
            },

            //Configure the server
            HOST_SERVER:{
                AUTH:'http://localhost:4100',
                DATABASE:'http://localhost:4400',
                STORAGE:'http://localhost:4500',
                MAIL:'http://localhost:4200',
            },
            API_VERSION:{
                AUTH:'/api/v1',
                DATABASE:'/api/v1',
                STORAGE:'/api/v1',
                MAIL:'/api/v1',
            },
            AUTO_REFRESH_TOKEN_TIMEOUT:1500000, //in millisecond= 25 minutes
            // A Unique Api key for all your servers
            API_KEY:your_api_key
        }
        let client =SwygerClient.init(config)
        //now you can do authentication
        let auth= client?.auth?.auth()
        auth.register({email,password},callback)
        //...
        
        //CRUD with database realtime
        let ref=client?.database?.database().ref('/your/path/reference') //like firebase
        //ref.create({object},callback)
        //OR listener
        //ref.onValue(callback)
        //...
        
        //CRUD with File in realtime
        let storageConfig={ //Discord/AWS/Google....
            token:'discord-bot-token',
            channelId:'discord-channel-id'
        }
        let location='local' //discord/aws/google
        let storageRef=client?.storage?.storage(location,storageConfig).ref('/your/parent/ref')
        //storageRef.upload({object},callback)
        //...

 </script>

Build Your Own JS Client Library

Note 0: Clone the repository:

git clone https://github.com/coorise/swyger-js-client.git

Note 1: For more details about how to use our API Consumer, visit the DOC : https://github.com/coorise/swyger-js-client/tree/master/doc/swyger/api.

Note 2: If you want to modify the entire api (eg:children route,...), you have to work with the main project (installing Node JS with the project dependencies npm i) then locate the ./src/api/api-route.js, once you are done just build it with npm run build, to get your new library in dist folder.

Todo

  • Removing/Reduce some unusual dependencies,functions, refactoring paths/files...
  • Making good and easy documentation with tutorials (videos, webpage...)
  • Code Cleaning/ Making a suitable project structure with modulable pattern

Join US

If you have any suggestion, feature to add ...etc

  • Discord(Support Team, FAQ, Chat): https://discord.gg/PPTZY5qFdC

Contributors

  • Agglomy Team :
    • Ivan Joel Sobgui

Licence

MIT: You can use it for educational/personal/business purpose!