Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

butter-require

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

butter-require - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

1

examples/js/typescript.js
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc