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

baby-tolk

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baby-tolk - npm Package Compare versions

Comparing version 1.4.1 to 2.0.0

59

lib/baby-tolk.js

@@ -29,35 +29,37 @@ 'use strict';

Object.keys(accord.all()).map(function (engine) {
if (adapters.indexOf(engine) === -1) {
return undefined;
}
try {
return accord.load(engine);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
console.error(e.message.replace(/^error: ?/i, 'Accord Error: ') + '. Try updating to the latest version');
var loadAdapters = function(customPath) {
Object.keys(accord.all()).map(function (engine) {
if (adapters.indexOf(engine) === -1) {
return undefined;
}
// else {
// console.error('Missing adapter:', engine);
// }
}
}).filter(function (engine) {
return engine;
}).forEach(function (adapter) {
if (adapter.engineName === 'babel') {
// Monkey-patching Babel adapter so that it doesn't try and compile all .js files
adapter.extensions = ['jsx', 'es6', 'babel'];
}
loadedAdapters.push(adapter);
var extensions = adapter.extensions.map(function (extension) { return '.' + extension; });
extensions.forEach(function (extension) {
if (!Array.isArray(extensionMap[extension])) {
extensionMap[extension] = [];
try {
return accord.load(engine, customPath);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
console.error(e.message.replace(/^error: ?/i, 'Accord Error: ') + '. Try updating to the latest version');
}
// else {
// console.error('Missing adapter:', engine);
// }
}
}).filter(function (engine) {
return engine;
}).forEach(function (adapter) {
if (adapter.engineName === 'babel') {
// Monkey-patching Babel adapter so that it doesn't try and compile all .js files
adapter.extensions = ['jsx', 'es6', 'babel'];
}
loadedAdapters.push(adapter);
var extensions = adapter.extensions.map(function (extension) { return '.' + extension; });
extensionMap[extension].push(adapter);
extensions.forEach(function (extension) {
if (!Array.isArray(extensionMap[extension])) {
extensionMap[extension] = [];
}
extensionMap[extension].push(adapter);
});
});
});
};

@@ -94,2 +96,3 @@ var targetExtension = {};

isMinifiable: minify.isMinifiable,
loadAdapters: loadAdapters,
read: function (pathName, options) {

@@ -96,0 +99,0 @@ options = options || {};

{
"name": "baby-tolk",
"version": "1.4.1",
"version": "2.0.0",
"description": "A file reader that promises to translate non-web assets to web assets given the available transpilers, sourcemaps and all",

@@ -42,29 +42,29 @@ "main": "lib/baby-tolk.js",

"accord": "davej/accord#patch-1-build",
"clean-css": "3.4.6",
"es6-promise": "3.0.2",
"html-minifier": "1.0.0",
"uglify-js": "2.5.0",
"when": "3.7.3"
"clean-css": "^3.4.9",
"es6-promise": "^3.0.2",
"html-minifier": "^1.1.0",
"uglify-js": "^2.6.1",
"when": "^3.7.5"
},
"devDependencies": {
"LiveScript": "1.3.1",
"babel": "5.8.23",
"coco": "0.9.1",
"coffee-script": "1.10.0",
"coveralls": "2.11.4",
"css-parse": "2.0.0",
"dogescript": "2.3.0",
"istanbul": "0.4.0",
"jade": "1.11.0",
"jshint": "2.8.0",
"less": "2.5.3",
"marked": "0.3.5",
"mocha": "2.3.3",
"mocha-lcov-reporter": "0.0.1",
"myth": "1.3.0",
"node-sass": "3.3.3",
"stylus": "0.52.4",
"swig": "1.4.2",
"unexpected": "10.0.1"
"LiveScript": "^1.3.1",
"babel": "^5.8.29",
"coco": "^0.9.1",
"coffee-script": "^1.10.0",
"coveralls": "^2.11.6",
"css-parse": "^2.0.0",
"dogescript": "^2.3.0",
"istanbul": "^0.4.1",
"jade": "^1.11.0",
"jshint": "^2.9.1-rc1",
"less": "^2.5.3",
"marked": "^0.3.5",
"mocha": "^2.3.4",
"mocha-lcov-reporter": "^1.0.0",
"myth": "^1.5.0",
"node-sass": "^3.4.2",
"stylus": "^0.52.4",
"swig": "^1.4.2",
"unexpected": "^10.4.0"
}
}

@@ -9,3 +9,3 @@ Baby Tolk

This is based on the [Tolk](https://github.com/Munter/tolk) library but does less things based on the "small modules that do one thing" philosophy. Specifically, it doesn't inline sourcemaps and doesn't autoprefix CSS.
This is based on the [Tolk](https://github.com/Munter/tolk) library but does less things based on the "small modules that do one thing" philosophy. Specifically, it doesn't inline sourcemaps and doesn't autoprefix CSS. It can also optionally minify assets, which Tolk doesn't support.

@@ -36,3 +36,3 @@ Baby Tolk is a "do the right thing" tool for transpiling. It reads a file from the file system, transpiles it (including sourcemaps where supported) with the available transpilers. It can also optionally minify the output.

Now you are ready to start reading files from the file system. Baby Tolk automatically loads the transpilers it has access to in the scope it is run in. By convention Baby Tolk won't compile any files if the filename begins with an underscore `_` character.
Now you are ready to start reading files from the file system. Baby Tolk automatically loads the transpilers it has access to in the scope it is run in. You can change the scope by passing a custom path to the `loadAdapters` method. By convention Baby Tolk won't compile any files if the filename begins with an underscore `_` character.

@@ -42,2 +42,6 @@ ```javascript

babyTolk.loadAdapters();
// Alternatively, you can pass a `customPath` to the node_modules folder if desired
// babyTolk.loadAdapters('/some/folder/node_modules');
babyTolk.read('path/to/stylesheet.scss').then(function (compiled) {

@@ -44,0 +48,0 @@ // compiled.result is the transpiled output as a string

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