Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chetan/sprockets-jst-str

Slurps template into a JavaScript string for use with Sprockets JST functionality
https://github.com/chetan/sprockets-jst-str

Last synced: 21 days ago
JSON representation

Slurps template into a JavaScript string for use with Sprockets JST functionality

Awesome Lists containing this project

README

        

# sprockets-jst-str

sprockets-jst-str is a [Sprockets](https://github.com/sstephenson/sprockets) plugin which simply returns the entire template as an escaped JavaScript string. For example, a file named __hello.jst.str__:

```html


Hello <%= get('name') %>


```

would turn into:

```js
'

\n Hello <%= get(\'name\') %>\n

';
```

In addition to single quotes, all backslashes, tabs and line breaks are also replaced with their respective symbols.