edu-role-play
raw JSON → 0.1.26 verified Fri May 01 auth: no javascript
A CLI tool for educational role-play scenarios: init, preview, lint, bundle. Current stable version 0.1.26. Low release cadence (few updates). Differentiator: integrates agent-skills for educational role-play generation. Minimal documentation.
Common errors
error SyntaxError: Unexpected token 'export' ↓
cause Using CommonJS with ESM-only package.
fix
Ensure your project uses ES modules ("type": "module" in package.json) and import instead of require().
error TypeError: eduRolePlay.init is not a function ↓
cause Default import used but package exports a named function.
fix
Use named import: import { init } from 'edu-role-play'.
Warnings
breaking Package is ESM-only. Using CommonJS require() will throw an error. ↓
fix Use import syntax instead of require().
gotcha No exported types; TypeScript users must declare module or use skipLibCheck. ↓
fix Add a declaration file leaf or set skipLibCheck: true in tsconfig.
deprecated CLI commands may change in future versions; API not stable. ↓
fix Pin to exact version and test before upgrading.
Install
npm install edu-role-play yarn add edu-role-play pnpm add edu-role-play Imports
- default wrong
const eduRolePlay = require('edu-role-play')correctimport eduRolePlay from 'edu-role-play' - init wrong
import init from 'edu-role-play/init'correctimport { init } from 'edu-role-play' - lint wrong
const { lint } = require('edu-role-play')correctimport { lint } from 'edu-role-play'
Quickstart
import eduRolePlay from 'edu-role-play';
async function main() {
try {
await eduRolePlay.init();
console.log('Project initialized.');
} catch (err) {
console.error('Failed:', err.message);
}
}
main();