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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@allnulled/anylang

v1.0.1

Published

Sintaxis abierta que siempre devuelve objetos de arrays.

Readme

anylang

Sintaxis abierta que siempre devuelve objetos de arrays.

Editor en línea

Con open-editor puedes crear ficheros *.any y compilar:

Instalar

npm i -g @allnulled/anylang

Uso desde consola

Si lo instalas globalmente (--g) luego puedes:

anylang compile file1.any file2.any file3.any

Y generaría los .json respectivos.

Uso desde API

Importar

En node.js:

require("@allnulled/anylang");

En browser:

<script src="node_modules/@allnulled/anylang/anylang.js"></script>

Usar

Una vez importado, tienes o en window o en global inyectada la variable AnylangParser, así que en ambos puedes hacer:

const ast = AnylangParser.parse("ya puedes parsear");

Sintaxis

En general, la idea es que los paréntesis {}, [] y () pueden usarse para agrupar cosas.

Y el texto se puede partir en cachos con ;\n.

Y el párser te lo agrupa.

Estas son las normas, 2 realmente.

Explicación más profunda

Lo que hace el párser es agrupar texto + grupos lógicos.

Los grupos lógicos son los paréntesis.

Finalmente, el texto se puede romper con ;\n.

A la hora de presentarlo:

  • Agrupa texto y grupos lógicos con un objeto, usando texto como propiedad, y grupos lógicos como valor en forma de lista, con grupos de esta estructura igual.
  • Cada grupo lógico se separa en diferentes objetos.
  • Pero los textos de un mismo grupo lógico se aplanan (flaten) en un objeto.

Esto es importante, porque esto significa que esta entrada:

object {1}
object {2}
object {3}
object {4}
object {5}

Sacará esto:

{
  "object": [
    {
      "5": []
    }
  ]
}

Así que ojo. Mientras entiendas esto, es bastante simple de intuir la estructura, y puedes iterar rápidamente con JavaScript.

Ejemplos

Uno de java:

clase Main {
    public static void main (String [] args) {
        System.out.println("Hola!");
    }
}

No es perfecto, pero algo te pilla:

{
  "clase Main": [
    {
      "private void int wherever = 10": [],
      "public static void main": [
        {
          "String": [
            null
          ],
          "args": []
        },
        {
          "System.out.println": [
            {
              "\"Hola!\"": []
            }
          ]
        }
      ]
    }
  ]
}

Uno de JavaScript:

module.exports = function(a, b, c) {
    let x = 100;
    print("Ma whereva");
}

Devuelve:

{
  "module.exports = function": [
    {
      "a, b, c": []
    },
    {
      "let x = 100": [],
      "print": [
        {
          "\"Ma whereva\"": []
        }
      ]
    }
  ]
}

Uno de SQL:

SELECT * FROM table WHERE (
    columna1 = 'x' AND (
        columna2 = 'y' OR
        columna2 = 'z'
    )
)

Sacaría esto:

{
  "SELECT * FROM table WHERE": [
    {
      "columna1 = 'x' AND": [
        {
          "columna2 = 'y' OR\n        columna2 = 'z'": []
        }
      ]
    }
  ]
}

Pero bueno. Para representar ideas guarras rápidamente.

Y al ver el JSON te haces una idea de una representación universal de tu idea.

Y si quieres, ya puedes usarlo, aunque no lo he hecho pensando en eso. Es la cosa de... poder expresar, ordenar y agrupar ideas con un lenguaje sin normas.

No es que se pueda parsear todo, evidente. Pero de paso, debería poder un poco.

Pero un poco. La idea es eso: expresar, ordenar y agrupar ideas en forma de texto.