0.0.1 • Published 9 months ago

@beyond-js/code v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@beyond-js/code

Simple utility functions for code manipulation.

Installation

npm install @beyond-js/code

Usage

const { header, scoped } = require('@beyond-js/code');

// Create a header for a file
const fileHeader = header('My JavaScript File');
console.log(fileHeader);

// Wrap code in a scoped IIFE
const myCode = `
const x = 1;
console.log(x);
`;
const scopedCode = scoped(myCode);
console.log(scopedCode);

API

  • header(text: string): string - Creates a comment header for code files.
  • scoped(code: string): string - Wraps code in a scoped IIFE and adds indentation.

License

MIT © [BeyondJS]

0.0.1

9 months ago