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

contratos

v0.0.1

Published

contratos

Downloads

24

Readme

contratos

Programming language to create and bind packages, classes and processes.

Index

  1. The idea
  2. Playground
  3. Installation
  4. Get started
  5. Examples
  6. Issues
  7. License

The idea

The idea of this language is that you create easily the contracts of 3 onthologies in which you should be able to wrap any software project:

  • package: any type of software module
  • class: a function that creates objects
  • process: a function

It is too simple, but this is the idea, to keep it simple, at least firstly.

Playground

You can play freely with it at:

There, you can use suggestions to find out the syntax of the language instead of continue reading.

Installation

$ npm install -g contratos

Get started

CLI usage

Write a simple contratos script (simple.cnt):

package package1
class ClassOne
process process1

Then compile it from the console:

$ contratos compile simple.cnt

A simple.cnt.json will be created representing the ast of your script. And that is all.

API usage

Syntax examples

These examples demonstrate all the available options per each idea: package, class and process.

A package

package package1
 file "somefile.txt"

A process

process process1
  file "x"
  uses classes Class1, Class2
  uses processes process1, process2
  that receives parameter1, parameter2
  that modifies parameter1, Class1.property
  that returns output

A class

class A
  file "class-a"
  extends AncestorOfA
  implements MutationOfA1, MutationOfA2
  uses packages package1, package2, package3
  uses classes Class1, Class2, Class3
  uses processes process1, process2, process3
  has 
    static property property1 set to 100
    property property2 set to 200
    static method method1
      uses packages package1
      uses classes Class1, Class2
      uses processes process1, process2
      that receives parameter1, parameter2
      that modifies parameter1, Class1.property
      that returns output
    method method2
      uses packages package1
      uses classes Class1, Class2
      uses processes process1, process2
      that receives parameter1, parameter2
      that modifies parameter1, Class1.property
      that returns output
    described as a custom description.

Issues

Please, send your issues and suggestions at the page of issues in the Github project, here.

License

This project is under WTFPL or do What The Fuck you want to Public License, so do what you want with it.