Registry / devops / init-roll

init-roll

JSON →
library1.4.0jsnpmunverified

A framework for project creation and migration, used to power create-xxx or @xxx/create-xxx packages. Current version is 1.4.0 (stable). Provides a simple API to initialize projects from templates with support for EJS templates, file strategies (delete, default, override), and JSON merging/deletion. Unlike Yeoman or other scaffolding tools, init-roll focuses on template-based initialization with built-in file conflict handling and package.json manipulation. Released under MIT license.

npm install init-roll
INSTALL
IMPORT
SIG · INIT-ROLL
I
init-roll
devopsjavascriptv1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

init
import { init } from 'init-roll'
import init from 'init-roll'
The default export is not available; init is a named export.
InitOptions
import type { InitOptions } from 'init-roll'
import { InitOptions } from 'init-roll'
Type-only import for TypeScript users.
require('init-roll')
const { init } = require('init-roll')
const init = require('init-roll')
CommonJS requires destructuring named exports.

Creates a project from a template directory using EJS parameters. The first argument is the template path, second is the output project path, third is an object of template variables.

import { init } from 'init-roll'; await init('/path/to/template', '/path/to/project', { name: 'my-app', description: 'My awesome app', version: '1.0.0', }); console.log('Project created successfully!');
Debug
Known issues
gotchaTemplate files with .default, .override, .delete extensions are processed as special strategies. If you want a literal file named 'file.default', you must escape or avoid these suffixes.
fix
Rename the file to avoid the reserved extension or use a different naming convention.
affects: >=1.0.0
deprecatedThe package API may change in future major versions. Always specify exact version in package.json.
fix
Pin version to 1.4.0 or use package-lock.json.
affects: >=1.0.0
gotchaEJS syntax in template file names (e.g., src/<%= name %>.js) is supported but may cause confusion if the name contains special characters.
fix
Ensure template variable values are filesystem-safe (no slashes, etc.).
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'init-roll'
Package not installed, or installed as dev dependency but import is used in production.
fix
Run 'npm install --save init-roll' (or --save-dev if only for development).
TypeError: init is not a function
Default import used instead of named import.
fix
Change 'import init from "init-roll"' to 'import { init } from "init-roll"'.
SyntaxError: Unexpected token '?'
Using ESM syntax in a CommonJS environment without proper module type.
fix
Set 'type': 'module' in package.json or use .mjs extension, or use require syntax.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
ejsrequiredUsed for template compilation (support for EJS syntax in template files and names).
Agent activity
8 hits · last 30 days
node
8
Resources
init-roll — npm install init-roll · libregistry