
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
local-sprockets-dotjs
Advanced tools
doT.js is an extremely fast JavaScript templating engine built for client side use and use with node.js. sprockets-dotjs makes it easy to use doT.js templates in Ruby web apps with Sprockets. Using sprockets-dotjs, your JS templates will be automatically be along with the rest of your assets in Sprockets. For example, Ruby on Rails users can take advantage of this feature in the Asset Pipeline. Precompiling assets on the server side saves precious browser cycles that would otherwise be wasted compiling the assets after downloading them.
sprockets-dotjs requires Rails 3.0 or above.
Simply include the gem in your Gemfile and then run bundle install
gem 'sprockets-dotjs', :git => 'git://github.com/jamifsud/sprockets-dotjs.git', :require => 'sprockets-dotjs'
Then create your doT.js template file in your assets/javascripts directory. Your templates must end with the extension .jst.djs in order to be processed as doT.js templates. The templates will then be available under the JST variable within the scope JST was created in (this is window by default, so window.JST or simply JST will give you access to the templates). For example:
app/assets/javascripts/templates/home.jst.djs:
<h1>This is my homepage. Hello {{= name }}</h1>
can be accessed with JST['templates/home']({ name: 'Joe' })
sprockets-dotjs is compatible with other JS template libraries that compile correctly under the .jst extension in Sprockets. For instance, Sprockets supports EJS templates (based on ERB templates), and sprockets-dotjs does not interfere with that support.
This is a very bare bones plugin setup, so any suggestions or updates are greatly appreciated. Simply submit a pull request to add to the code base.
FAQs
Unknown package
We found that local-sprockets-dotjs 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
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.