Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cabin

Package Overview
Dependencies
Maintainers
0
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cabin

build little html buildings with css selectors and stuff

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-28.66%
Maintainers
0
Weekly downloads
 
Created
Source

Cabin

For building little pieces of html quickly with functions that act as templates.... I think.

The only cool (terrible?) part is that you can built elements with css-like selectors, so it's easy to make a div with an id of "fresh". cabin("div#fresh"). The same thing works for classes. cabin("div.some.fresh.classes").

Cabin.curry is a function cabin.curry, which curries your template function, so you can do something like this:

var build = cabin.curry(function(o,info){
  return true,
    o("li.building",
      o("h1",
        o("strong", info.name), " ", o("em", "Jr.")
      ),
      o("h3.age","is " + info.age)
    );
});

You're right, it just gives you a local reference as the first argument to your function. Not actually cool. But whatevs. But now you can call build({ name: "Old Log Cabin", age: 100 }) and you'll get back a dom node, which you can feel free to append as a child to something.

FAQs

Package last updated on 18 May 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc