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

tays

v0.0.1

Published

Does Stuff

Downloads

1

Readme

#no this doesnt work yet

General Idea: decorators just build an ast and return noop function decorators when activerecord is called (last in file) the association and callback asts are parsed into an underlying framework class and the user defined class is copied on top of it. This will maintain the super functionality without a Proxy method being called on every single method call. Take advantage of the prototype system in js rather than shoving everything into method_missing / proxy.get

Stuff in /lib/meta works. Thinking about including under a class with a copy on top of it so that super would work for included stuff. Public interface would remain the same.

Arel mostly copy pastad from ruby. Interface for ActiveRecord is too stronk for most projects not to copy pasta. Implementation will have to change because javascript differently strong from ruby. All licenses can be found in LICENCE.md.

Some desired syntax abusing decorators as not decorators and as just carefully placed functions to look beautiful.

// models/user.js
import { CustomValidator } from './validators'
import { NullRole } from './null_role'
import {
  ActiveRecord,
  before_save,
  belongs_to,
  has_many,
  scope,
  validates_presence_of
  validates_with,
} from 'tays'

class User extends ActiveRecord.Base {
  @belongs_to('role')
  @has_many('posts', { class_name: 'ShitPost' })

  @validates_presence_of('email')
  @validates_with(CustomValidator)

  @scope('admin', () => this.joins('role').where({ admin: true }))

  custom_method() {
    //do anything you want
  }

  @before_save
  method_called_before_save() {
    // do some stuff
  }

  get role() {
    return super.role || new NullRole()
  }

}

export ActiveRecord(User)

No, I have no idea what the hell I'm doing. Just bored and what to write some bootyful havascript.