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

osomar-script

v1.1.1

Published

A programming language inspired by JavaScript and infused with the vibrant vibe of Osomar

Downloads

5

Readme

Getting Started

Installation

$ npm install osomar-script -g

Alternatively, you can download the binaries from the release page and use them directly, bypassing the npm installation.

Usage

Compile and run

$ os <filename>.os

Use REPL

$ os -r

Show help

$ os -h

Your First Program

To begin writing OsomarScript code, create a new file with a .os extension and start coding. Here's a simple "Hello, World!" program:

// hello.os
ctm("Hello World") jajaja

Language Basics

Syntax

  • Comment: //
  • Statement End: jajaja
  • Code Block Start: "🃏
  • Code Block End: 🃏"

Data Types

  • number: Numeric data type for integers and floating-point numbers.
  • string: Textual data enclosed in double quotes.
  • falso: Logical data type representing False
  • verdad: Logical data type representing true
  • sepa dios: Represents an intentional absence of any value (null).

Variables

Variables are declared using the Ei keyword, and can be initalized when declared.

// Uninitialized variable
Ei x jajaja

// Initialized variable
Ei y es 10 jajaja

Operators

  • Arithmetic Operators: +, -, *, /
  • Comparison Operators: ==, !=, >, <, >=, <=
  • Logical Operators: &&, ||
  • Assignment Operator: es

Control Structures

While loop

  • Executes a block of code wrapped in "🃏 🃏" as long as the condition inside () evaluates to true.

  • Declared using the no digas mamadas mientras keyword.

  • Break out of the block of code with the keyword mamo

no digas mamadas mientras (condition) "🃏

  //Code

🃏"


//Infinite loop with break keword
no digas mamadas mientras (verdad) "🃏

  ctm("start") jajaja //will run

  mamo jajaja //break out of loop

  ctm("end") jajaja //won't run

🃏"

If Statement

  • The if statement allows you to execute a block of code wrapped in "🃏 🃏" conditionally based on the condition inside ().
  • Declared using the hijo mio si keyword.
  • Use the de lo contrario keyword to define what to do if the condition is not true.
//Example 3
hijo mio si (condiition) "🃏

  //Code

🃏"


//Example 2
hijo mio si (condiition) "🃏

  //Code if true

🃏" de lo contrario "🃏

  //Code if false

🃏"

You can chain If Statements

//Example 3

hijo mio si (condition_1) "🃏

  //if cond 1

🃏" de lo contrario hijo mio si (condition_2) "🃏

  //if cond 2

🃏" de lo contrario "🃏

  //else

🃏"

Printing

OsomarScript provides a print function to display output to the console, call it with ctm()

ctm("Hello world") jajaja

Functions

Functions allow you to encapsulate reusable pieces of code. They can be declared using the we keyword and can accept parameters and return values with the keyword nmms.

we square(num) "🃏
  nmms num * num jajaja //return num * num
🃏"

ctm(square(5)) jajaja // Output: 25

Example Program

// Variables
Ei miNombre es "Osomar" jajaja
Ei miNumero es 5 jajaja
Ei miVerdadero es verdad jajaja
Ei miFalso es falso jajaja
Ei miNull es sepa dios jajaja


//Printing
ctm(miNombre) jajaja

// Conditional statement
Ei x es 1 jajaja

hijo mio si (x == 1) "🃏

  ctm("Num 1") jajaja

🃏" de lo contrario hijo mio si (x==2) "🃏

  ctm("Num 2") jajaja

🃏" de lo contrario "🃏

  ctm("Num any") jajaja

🃏"


// Function
we square(num) "🃏
  nmms num * num jajaja //return num * num
🃏"

ctm(square(5)) jajaja // Output: 25


// While loop
Ei countdown es 3 jajaja
no digas mamadas mientras (countdown > 0) "🃏

  ctm(countdown)jajaja
  countdown es countdown - 1 jajaja

🃏"


no digas mamadas mientras (verdad) "🃏

  ctm("Solo se corre una vez") jajaja
  mamo jajaja //Break

🃏"