Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Easy DSL to create HTML in CoffeeScript
CARE Markup Language is an elegant DOM DSL built using ES6 proxies and CoffeeScript classes. Provides a slightly more OO approach to DOM generation than the likes of HyperScript or JSX.
class Page extends Builder then tag: 'div', id: 'page', children: ->
@div['#header'] ->
@h1.classy 'h', style: { 'background-color': '#22f' }
@div.wow['#menu'].amaze style: { 'background-color': '#2f2' }
@ul ->
@li 'one'
@li 'two'
@li 'three'
@h2 'content title', style: { 'background-color': '#f22' }
@p '''
lots of content inside here using
triple-quote strings
'''
@p '''
the intention is to use this over JSX or
interpolated strings. Your html will be
guaranteed valid since it is generated with
DOM api and it is implemented with a neat DSL
that fully utilizes the `@` operator
'''
npm install careml
or
yarn install careml
import Builder from 'careml'
class MyElement extends Builder
tag: 'section'
class: ['mine', 'main']
children: ->
# Here is where you use the DSL
@article ->
@p 'Content here'
@p 'More content'
This class has several shortcuts for making HTML elements but the real heart of it is the DSL inside the children
function.
To build HTML, you provide the tag name as a field of this
or @
in CoffeeScript e.g.:
@div
This creates a <div></div>
element utilizing the DOM createElement
method.
You can provide arguments to this just like HyperScript:
@h1 'My Amazing Blog'
@h3 'by Yours Truly', style: { 'font-size': '20px' }
<h1>My Amazing Blog</h1>
<h3 style="font-size:60px;">by Yours Truly</h3>
Attributes can be added like the style
element above and they can be interwoven with other children.
@a href: '#', 'Click here!'
FAQs
Coffeescript DOM DSL
The npm package careml receives a total of 0 weekly downloads. As such, careml popularity was classified as not popular.
We found that careml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.