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

lesl

v1.1.1

Published

LESL - The simple and fun 'programming language'

Downloads

2

Readme

LESL 'programming language'

The LESL is current in beta, and have some bugs:

  • Console highlighting is too buggy Minuses:
  • LESL not have functions
  • Not standart syntax

The syntax

Variables

Grammar:

name -> value

Example:

x -> 1
y -> 5

a -> 3
b -> 2
String functions

Variables has 'prototype' of string functions.

Math with variables

Variables may used in equations.

Example:

x -> 5
y -> 6

x + y * x

=> 35

Comments

# Comment


IF

a (is|not|less|more) b (and c (is|not|less|more) d)...? [ true ] : [ false ]

Example:

a not b?
=>  true
x is y? [ "OK"  ]:["NOK"]
=> NOK

Marks

name [ source ]

Call mark
name!

Example:

greeting [
	"Hello, World"
]

greeting!

=> Hello, World

from-to loop

Returns list from x to y, separated by ','

Standart

Grammar:

from x to y

Example:

from 1 to 12

=> 1,2,3,4,5,6,7,8,9,10,11
Short

Grammar:

x..y

Example:

1..12

=> 1,2,3,4,5,6,7,8,9,10,11
Math with lists

You may do math only(!) with short lists. If we look at this example:

1..5 + 1

That outputs

=> 2,3,4,5

That pluses 1 to EACH list element. If we look at another example:

1..5 ^ 4

That outputs

=> 1,16,81,256

That makes pow of EACH list element.

Numbers
Dollars

LESL have built-in dollar translation. To select course, create in root of LESL file options.json, and write content like this:

{
	dollar: 56.9
}

After this simple operation, you may do dollar translation:

  200$
=> 11611

And do with this dollars mathematical operations:

200$ + 12000 - 5000
=> 18611
Floats

Float is number with floating point.

Example:

12.5
1.3
0.6
19.4
3.14
Integers

Example:

	1
	53
	12
	75
	666
	999
	512

Strings

String is all inside double quotes, besides newlines, and double quotes.

Example:

"Hello, World"

"Hi"

"Hi, NPM"
String methods

String also has functions for operate with it.

  • str.slice s, e

    Slices from start(s) position to end (e) position.

    Example:

      	"Hello".slice 2, "Hello".len
    
      	=> llo
  • str.len

    Get length of str string.

    Example:

      "Hi".len
    
      => 2
  • str.uppercase

    Convert string to uppercase.

    Example:

      "Alexey".uppercase
    
      => ALEXEY
  • str.lowercase

    Convert string to lowercase.

    Example:

      "Alexey".lowercase
    
      => alexey
  • str.capitalize

    Make first letter in string uppercase.

    Example:

      "i am here".capitalize
    
      => I am here
  • str.reverse

    Reverses the string.

    Example:

      "Hello, World!".reverse
    
      => !dlroW ,olleH
  • str.char i

    Get char on i index in str.

    Example:

      "Hellow".char "Hello".len
    
      => w

Include other files

To include other files, you also may use 'use' command. That imports all variables and marks from including files.

use name - String

Example:

use "core/booleans"

$> true

=>  1

$> false

=> 2

$> LESLBooleans!

=> LESLBooleans library by Alexey Yurchenko
	 true / false / yes / no  / ok / nok

Examples

Hello, World!
"Hello, World!"

=> Hello, World!
Math
12 * 2^4

=> 192

2 + 2

=> 4
Math constants library
./math_const.lesl

PI -> 3.14
E ->  2.71

./example.lesl

use "math_const"

PI

=> 3.14

E

=> 2.71

PI + E

=> 5.85

(C) Alexey Yurchenko.

Sorry for bad english.