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

lits-parser

v1.0.0

Published

A lisp implementation in Typescript

Downloads

68

Readme

A lisp implementation in Typescript. Could be used in browser, node.js or as a CLI.

REPL

Documentation

mojir.github.io/lits

Install

npm i -g lits-parser

Repl usage

Start the lits REPL in a terminal by enter lits

  • Tab completion
  • History stored on file
$ lits
Type "`help" for more information.
LITS> (+ 7 4)
11
LITS> (let ((day (* 24 60 60 1000))) (* 7 day)) ; Ever wondered how many milliseconds there are in a week?
604800000
$ lits --help
Usage: lits [options]

Options:
  -g ...                          Global variables as a JSON string
  -G ...                          Global variables file (.json file)
  -f ...                          .lits file
  -e ...                          Lits expression
  -h, --help                      Show this help
  -h, --help <builtin function>   Show help for <builtin function>
  -v, --version                   Print lits version
$ lits -e "(/ 81 9)"
9

API

Install api

npm i lits-parser

How to use?

import { Lits } from 'lits-parser'

const lits = new Lits()
lits.run('(+ 1 2 3 4)'); // returns 10

Builtin Functions

Special functions

  • and
  • cond
  • def
  • defn
  • defns
  • defs
  • do
  • fn
  • for
  • if
  • if-let
  • if-not
  • let
  • loop
  • or
  • recur
  • throw
  • time!
  • try
  • when
  • when-first
  • when-let
  • when-not

Normal functions

Predicate

  • array?
  • boolean?
  • coll?
  • even?
  • false?
  • finite?
  • function?
  • integer?
  • nan?
  • neg?
  • negative-infinity?
  • nil?
  • number?
  • object?
  • odd?
  • pos?
  • positive-infinity?
  • regexp?
  • seq?
  • string?
  • true?
  • zero?

Sequence

  • cons
  • distinct
  • drop
  • drop-last
  • drop-while
  • filter
  • first
  • frequencies
  • group-by
  • index-of
  • join
  • last
  • map
  • next
  • nth
  • nthnext
  • nthrest
  • partition
  • partition-all
  • partition-by
  • pop
  • position
  • push
  • rand-nth!
  • random-sample!
  • reduce
  • reduce-right
  • reductions
  • remove
  • rest
  • reverse
  • second
  • shift
  • shuffle
  • slice
  • some
  • sort
  • sort-by
  • split-at
  • split-with
  • take
  • take-last
  • take-while
  • unshift

Collection

  • any?
  • assoc
  • assoc-in
  • concat
  • contains?
  • count
  • empty?
  • every?
  • get
  • get-in
  • has?
  • has-every?
  • has-some?
  • not-any?
  • not-empty
  • not-empty?
  • not-every?
  • update
  • update-in
  • Array
  • array
  • flatten
  • mapcat
  • range
  • repeat

Object

  • dissoc
  • entries
  • find
  • keys
  • merge
  • merge-with
  • object
  • select-keys
  • vals
  • zipmap

String

  • from-char-code
  • lower-case
  • number
  • number-to-string
  • pad-left
  • pad-right
  • split
  • str
  • string-repeat
  • subs
  • template
  • to-char-code
  • trim
  • trim-left
  • trim-right
  • upper-case

Math

  • *
  • +
  • /
  • abs
  • acos
  • acosh
  • asin
  • asinh
  • atan
  • atanh
  • cbrt
  • ceil
  • cos
  • cosh
  • dec
  • e
  • epsilon
  • exp
  • floor
  • inc
  • log
  • log10
  • log2
  • max
  • max-safe-integer
  • max-value
  • min
  • min-safe-integer
  • min-value
  • mod
  • nan
  • negative-infinity
  • pi
  • positive-infinity
  • pow
  • quot
  • rand!
  • rand-int!
  • rem
  • round
  • sign
  • sin
  • sinh
  • sqrt
  • tan
  • tanh
  • trunc

Functional

  • apply
  • comp
  • complement
  • constantly
  • every-pred
  • fnil
  • identity
  • juxt
  • partial
  • some-pred

Regular expression

  • match
  • regexp
  • replace

Bitwise

  • bit-and
  • bit-and-not
  • bit-clear
  • bit-flip
  • bit-not
  • bit-or
  • bit-set
  • bit-shift-left
  • bit-shift-right
  • bit-test
  • bit-xor

Misc

  • <
  • <=
  • =
  • >
  • >=
  • assert
  • boolean
  • compare
  • debug!
  • equal?
  • inst-ms
  • lits-version
  • not
  • not=
  • write!