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

lightpl

v0.0.4

Published

Lightweight programming language

Downloads

9

Readme

Get started

Install

npm i -g lightpl

To execute:

light <file_name>

To translate to js:

light <file_name> -js

Hello world

To print "Hello world" in terminal, create new file hello_world.lpl, then print:

print('Hello world')

and run(in terminal):

light hello_world.lpl

Language tour

Variables

Variables can be defined with "var" keyword

var variableName

Multiple variables can be defined together, separated by coma

var variable1, variable2, variable3

During definition variables can be initialized

var variable = 0

Values

Number

Variables can contain number

var variable = 0

String

String should be in single quote

var variable = 'Hello world'

Bool

Bool is one of two literals

var on = true
var off = false

Null

Null represent nothing

var empty = null

Collections

List

to store similar data you can use lists

var list = [1, 23, 1234]

Map

to store data as "key" "value" pares

var legs = [
    'dog': 4,
    'cat': 4,
    'spider': 8
]

Control flow statements

If

if statements with optional else statements:

if age < 18 {
    print('Access deny')
} else {
    print('Hello')
}

While

A while loop evaluates the condition before the loop:

while apples > 0 {
    print('You have ' + apples + ' apples')
    apples = apples - 1
}

For

"for" is iteration for collections:

for var item in beg {
    print(item)
}

Operations

Mathematical

'+', '-', '*', '/'

var ourMoney = myMoney + yourMoney

Comparision

'==', '!=', '>=', '<=', '>', '<'

if playerHealth == 0 {
    print('You lose')
}

Logical

'!', '&&', '||'

if day == 'sunday' || day == 'saturday' {
    print('This is weekend')
}

Comments

you can comment your code to explain it purpose

// We store time in seconds but show it in minutes
print(time / 60)