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

@qcom.io/qcom

v1.0.40

Published

Qcom is a Javascript Framework for creating Custom web components or web Elements with Dynamic HTML generating functions. No more HTML tags and css styling required.

Downloads

104

Readme

Qcom.io

NPM version Downloads

demoofqcom

Javascript Framework

Installation

npm install @qcom.io/qcom

Or CLI Installation for Quick Start

npx @qcom.io/qcom-cli
npm start

check url

http://localhost:8080

Or Use following code to your html file

<script type="module">
  import $ from 'https://unpkg.com/@qcom.io/qcom'
  // Or import $ from './node_modules/@qcom.io/qcom/index.js'
  $() // Now check your Inspector of Browser He will guide you for further steps
</script>

index.html

<qcom-hello-world></qcom-hello-world>

<script type="module">
  import $ from 'https://unpkg.com/@qcom.io/qcom'
  // Or import $ from './node_modules/@qcom.io/qcom/index.js'
  $({
      name:'QcomHelloWorld',
      template:()=>h1('Hello World')
  })
</script>

Rules

HTML

<h1 class="head"  style = "color:red;  background-color:  yellow"    id="heading" > I am H1 </h1>

Qcom

h1({class:'head', style:{ color:'red', backgroundColor : 'Yellow' }, id:'heading' }, 'I am H1' )

Functions

<qcom-functions></qcom-functions>

<script type="module">
  import $ from 'https://unpkg.com/@qcom.io/qcom'
  $({
      name:'QcomFunctions',
      template:()=>div(h1({click:'QcomFunctions.log()'},'Click Here')),
      code:{
          log:()=>{
              //Do something here
              alert('clicked')
          }
          //Create your own functions here like log()
      }
  })
</script>

Data Management

<qcom-data></qcom-data>

<script type="module">
  import $ from 'https://unpkg.com/@qcom.io/qcom'
  $({
      name:'QcomData',
      data:{
          counter:0
      },
      template:()=>div( /* div must be here to wrap all internal tags*/
                        h1(this.data.counter),
                        button({click:'QcomData.add()'},'+'),
                        button({click:'QcomData.sub()'},'-')
                     ),
      code:{
            add:()=>{
                    this.data.counter +=  1
                    this.render()
            },
            sub:()=>{
                    this.data.counter -=  1
                    this.render()
            }
      }
  })
</script>

Loop

<qcom-loop></qcom-loop>

<script type="module">
  import $ from 'https://unpkg.com/@qcom.io/qcom'
  $({
      name:'QcomLoop',
      data:{
          items:[{id:1,name:'Abigail',age:21},
                {id:2,name:'max',age:29},
                {id:3,name:'Alison',age:17},
                {id:4,name:'bob',age:32},
                {id:5,name:'brad',age:36}]
      },
      template:()=>div(
                    table(
                        tr(
                            td('Index'),
                            td('Name'),
                            td('Age')
                        ),
            ()=>this.data.items.map(item =>
                    tr(
                        td(item.id),
                        td(item.name),
                        td(item.age))
                        )
                    )
                )
  })
</script>

Get Api

<qcom-get></qcom-get>

<script type="module">
import $ from 'https://unpkg.com/@qcom.io/qcom'
$({
    name:'QcomGet',
    data:{
        items:[]
    },
    template:()=>div(
        table(
            tr(
                td('Id'),
                td('Title'),
                td('completed')
            ),
            ()=>this.data.items.map(item =>
                    tr(
                        td(item.id),
                        td(item.title),
                        td(item.completed))
                        )
        )
    ),
    code:{
        onload:async ()=>{
            this.data.items = await qcom.get('https://jsonplaceholder.typicode.com/todos/')
            this.render()
        }
    }
})

</script>

Styling (camelCase is required while using style)

<qcom-css-example></qcom-css-example>

<script type="module">
  import $,{color} from 'https://unpkg.com/@qcom.io/qcom'
  $({
      name:'QcomCssExample',
      globalcss:{ /* Global CSS*/
          '*':{
              margin:'50px',
              padding:'50px'
          }
      },
      css:{ /* Internal CSS*/
          h1:{
              color:color.red,
              cursor:'pointer',
              backgroundColor:color.yellow
          },
          '.mt':{
              marginTop:'5px'
          }
      },
      template:()=>div(
                        h1({class:'mt',style:{ /* Inline CSS*/
                            border:'2px solid red'
                        }},'Inline Internal and global Style')
                    )
  })

</script>

Qcom Router

<qcom-main></qcom-main>
<script type="module">
import $ from 'https://unpkg.com/@qcom.io/qcom'
    let QcomOne = {
        name:'QcomOne',
        data:{
            items:[
                {name:'mahesh'},{name:'dipak'}
            ]
        },
        template:()=>div(h1('Page One'),
                ()=>this.data.items.map(item =>
                        div(item.name)))
    }
    let QcomTwo ={
        name:'QcomTwo',
        data:{
            items:[]
        },
        template:()=>row(
            col(form(
                material(
                    h1('Registration'),
                    input({id:'name',class:'mb6',placeholder:'Name'}),
                    input({id:'email',class:'mb6',placeholder:'Email'}),
                    input({id:'password',class:'mb6',placeholder:'Password'}),
                    right(btn({click:'QcomTwo.post()',is:'md'},'Submit')))
            )),
            col(table(
                tr(
                    td('Name'),
                    td('Email'),
                    td('Password')
                ),
                ()=>this.data.items.map(item =>
                        tr(td(item.name),
                            td(item.email),
                            td(item.password)))
            ))
        ),
        code:{
            post:()=>{
                this.data.items.push({
                    name:getval('name'),
                    email:getval('email'),
                    password:getval('password')
                })
                this.render()
            }
        }
    }
    let QcomError = {
        name:'QcomError',template:()=>div(
            h1('404 Page')
        )
    }
    $({
        name:'QcomMain',
        template:()=>div(
                appbar(
                    btn({route:'/QcomOne',is:'link', class:'ml12'},'One'),
                    btn({route:'/QcomTwo',is:'link', class:'ml12'},'Two'),
                    btn({route:'/QcomError',is:'link', class:'ml12'},'404')
                ),
                div({class:'mt12', id:'root'})
            ),
       include:[QcomOne,QcomTwo,QcomError],
            router:{
                root:'QcomOne',
                view:'root',
                error:$('QcomError')(),
                links:['QcomOne','QcomTwo']
            }
    })
</script>

Demo

demoofqcom

Grammar:

                                        function
 ┌─────────-───────────────────────────────┴────────────────────────────────────────────────────────┐
 │                            separators                                                            |
 │                   ┌────────────┴───┬────────────────┬───────────────────────────┐                |
 |                   ↓                ↓                ↓                           ↓                |
p(  { to:'firstname' ,   class:'mt12' , id:'firstname' , style: {color:color.red} }, 'Hello World'  )
        └───┬───┘          └───┬───┘     └────┬───┘       └────┬────────┘                 |
            ┴───────────┬──────┴─────-──-─────┘-──-─────-─────-┘                          |
                   attributes                                                           Text

Configuration

Colors

color00 color0 color1 color2 color3 color4 color5

License

MIT