{"id":26489,"library":"tolk","title":"Tolk","description":"Tolk is a file reader that automatically transpiles files with available transpilers, inlines sourcemaps, and autoprefixes CSS. It uses a zero-dependency approach for transpilers, requiring users to install them separately (e.g., node-sass, babel). The current stable version is 2.0.0. It supports multiple precompilers including LiveScript, Babel, CoffeeScript, Less, Stylus, and more. Key differentiator: no bundled transpiler dependencies, allowing users to choose and install only what they need.","status":"maintenance","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Munter/tolk","tags":["javascript","web","asset","transpile","compile","es6","babel","jsx","sass"],"install":[{"cmd":"npm install tolk","lang":"bash","label":"npm"},{"cmd":"yarn add tolk","lang":"bash","label":"yarn"},{"cmd":"pnpm add tolk","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses CommonJS; no ES module export.","wrong":"import tolk from 'tolk';","symbol":"default","correct":"const tolk = require('tolk');"},{"note":"Method is `read`, not `readFile`.","wrong":"tolk.readFile('file.scss')","symbol":"read","correct":"tolk.read('file.scss').then(...)"},{"note":"Returns a promise-like object with `.done()` method; does not accept Node-style callbacks.","wrong":"tolk.read('file.jsx', callback)","symbol":"read","correct":"tolk.read('file.jsx').done(...)"}],"quickstart":{"code":"const tolk = require('tolk');\nconst path = require('path');\n\n// Ensure you have a transpiler installed, e.g., node-sass\n// npm install node-sass --save-dev\n\ntolk.read(path.join(__dirname, 'styles.scss')).then(compiled => {\n  console.log(compiled.result); // Compiled CSS\n}).catch(err => {\n  console.error('Transpilation failed:', err.message);\n});","lang":"javascript","description":"Reads a SCSS file, transpiles with installed transpiler, and logs the resulting CSS."},"warnings":[{"fix":"Install required transpilers, e.g., `npm install babel` for ES6/JSX support.","message":"No built-in transpilers: you must install them separately.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `.done(success, fail)` or replace with `.then(success, fail)` after wrapping.","message":"Promise interface: uses `.done()` instead of standard `.then()` and `.catch()`.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider alternatives like gulp-sass or webpack loaders.","message":"Package has not been updated since 2016; no support for modern tooling.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `.done()` instead of `.then()`, or call `.then()` on the returned object.","cause":"Tolk returns a promise-like object with `.done()` method; if you try to use `.then()`, it may fail if not chained correctly.","error":"TypeError: tolk.read(...).done is not a function"},{"fix":"Run `npm install tolk` in your project directory.","cause":"Tolk is not installed, or installed globally instead of locally.","error":"Error: Cannot find module 'tolk'"},{"fix":"Install the transpiler: `npm install babel`.","cause":"Required transpiler (e.g., babel) is not installed.","error":"Error: No transpiler found for file extension '.jsx'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}