butter-require
Advanced tools
Comparing version 0.0.2 to 0.0.3
require('../../')('typescript'); | ||
var hello = require('./helloworld.ts'); |
24
index.js
@@ -28,5 +28,15 @@ var path = require('path'), | ||
require: 'coffee-script' | ||
, extensions: ['coffee'] | ||
, extensions: ['coffee', 'litcoffee', 'coffee.md'] | ||
, aliases: ['coffee-script'] | ||
} | ||
, 'livescript': { | ||
require: 'LiveScript' | ||
, extensions: ['ls'] | ||
, aliases: ['LiveScript', 'live-script'] | ||
} | ||
, 'coco': { | ||
require: 'coco' | ||
, extensions: ['co'] | ||
} | ||
, 'six': { | ||
@@ -110,11 +120,13 @@ require: 'six', | ||
function requireFormat (format) { | ||
var req; | ||
try { | ||
require(format.require); | ||
req = require(format.require); | ||
if ((format.require === 'coffee-script') && (req.VERSION >= '1.7.0')) | ||
req.register(); | ||
} | ||
catch (e) { | ||
format.extensions.forEach(function (extension) { | ||
// console.log(extension); | ||
format.extensions.forEach(function (extension) { | ||
var extMsg = format.install('*.' + extension); | ||
require.extensions['.' + extension] = function(module, filename) { | ||
var err = new Error(format.install(filename)); | ||
throw err; | ||
throw new Error('butter-require error loading ' + filename + '\n' + extMsg ); | ||
}; | ||
@@ -121,0 +133,0 @@ }); |
{ | ||
"name": "butter-require", | ||
"version": "0.0.2", | ||
"description": "A lesser fork of 'olalonde/better-require' - lets you load JSON and YAML files using require syntax. For example: var config = require('./config.json'); Extensions available are: json, yaml.", | ||
"version": "0.0.3", | ||
"description": "A fork of 'olalonde/better-require' - lets you load JSON and YAML files using require syntax. For example: var config = require('./config.json'); Extensions available are: json, yaml, coffee, ts, ls, co", | ||
"main": "index.js", | ||
@@ -28,5 +28,9 @@ "scripts": { | ||
"typescript", | ||
"ts" | ||
"ts", | ||
"LiveScript" | ||
], | ||
"author": "Olivier Lalonde <olalonde@gmail.com>", | ||
"author": { | ||
"name": "Agelos Pikoulas", | ||
"email": "agelos.pikoulas@gmail.com" | ||
}, | ||
"license": "BSD", | ||
@@ -39,3 +43,5 @@ "dependencies": { | ||
"require-ini": "", | ||
"coffee-script": "" | ||
"coffee-script": "", | ||
"LiveScript": "", | ||
"coco": "*" | ||
}, | ||
@@ -42,0 +48,0 @@ "devDependencies": { |
@@ -1,4 +0,5 @@ | ||
A fork of [better-require](https://github.com/olalonde/better-require) with less supported formats, | ||
mainly for usage in [uRequire](https://github.com/anodynos/uRequire) due to [some](https://github.com/olalonde/better-require/issues/3) [issues](https://github.com/olalonde/better-require/issues/2) and being *too heavy*. | ||
A fork of [better-require](https://github.com/olalonde/better-require) with less supported formats, mainly for usage in [uRequire](https://github.com/anodynos/uRequire) due to [some](https://github.com/olalonde/better-require/issues/3) [issues](https://github.com/olalonde/better-require/issues/2) and being *too heavy*. | ||
v0.3 also works well with coffee-script -post & pre 1.7.x- (.coffee, .litcoffee, .coffee.md, ) & also LiveScript (.ls) & coco (.co). | ||
Formats (& dependencies) removed: | ||
@@ -10,2 +11,4 @@ | ||
You can still manually install them of course... | ||
Original docs follow: | ||
_________________________________________________________ | ||
@@ -12,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157
92
10921
8
20
9
+ AddedLiveScript@
+ Addedcoco@*
+ AddedLiveScript@1.3.1(transitive)
+ Addedcoco@0.9.1(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addedfast-levenshtein@1.0.7(transitive)
+ Addedlevn@0.2.5(transitive)
+ Addedoptionator@0.4.0(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedwordwrap@0.0.3(transitive)