Skip to content

Commit

Permalink
rename to string-to-js
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 7, 2012
1 parent 9d18697 commit 20ed7aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Readme.md
@@ -1,11 +1,11 @@

# html-to-js
# string-to-js

Make HTML require()-able.
Make plain text (HTML, CSS, JSON, etc) require()-able.

## Installation

$ npm install html-to-js
$ npm install string-to-js

## Example

Expand All @@ -26,11 +26,11 @@ js:
*/

var fs = require('fs')
, html2js = require('html-to-js')
, str2js = require('string-to-js')
, read = fs.readFileSync;

var html = read('tip.html', 'utf8');
var js = html2js(html);
var js = str2js(html);
console.log(js);
```

Expand Down
2 changes: 1 addition & 1 deletion index.js
@@ -1,6 +1,6 @@

/**
* Convert `str` of html to a string of js.
* Convert `str` to a module.exports string.
*
* @param {String} str
* @return {String}
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,8 +1,8 @@
{
"name": "html-to-js",
"name": "string-to-js",
"version": "0.0.1",
"description": "Make HTML require()-able",
"keywords": ["html", "require"],
"description": "Make plain text (HTML, CSS, JSON, etc) require()-able",
"keywords": ["html", "css", "json", "require"],
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"dependencies": {},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions test/index.js
Expand Up @@ -4,14 +4,14 @@
*/

var fs = require('fs')
, html2js = require('..')
, str2js = require('..')
, read = fs.readFileSync
, vm = require('vm')

describe('html2js(str)', function(){
describe('str2js(str)', function(){
it('should return js', function(){
var html = read('test/tip.html', 'utf8');
var js = html2js(html);
var js = str2js(html);
var mod = { exports: {} };
vm.runInNewContext(js, { module: mod });
mod.exports.should.equal(html);
Expand Down

0 comments on commit 20ed7aa

Please sign in to comment.