Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/featherscloud/opensource
Feathers Cloud open source projects
https://github.com/featherscloud/opensource
authentication code-generation generators typescript
Last synced: 17 days ago
JSON representation
Feathers Cloud open source projects
- Host: GitHub
- URL: https://github.com/featherscloud/opensource
- Owner: featherscloud
- License: mit
- Created: 2021-12-27T02:31:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-02T22:32:25.000Z (20 days ago)
- Last Synced: 2025-01-02T23:26:57.842Z (20 days ago)
- Topics: authentication, code-generation, generators, typescript
- Language: TypeScript
- Homepage: https://feathers.cloud
- Size: 2.08 MB
- Stars: 83
- Watchers: 4
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: .github/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Pinion
[![CI](https://github.com/feathershq/pinion/actions/workflows/nodejs.yml/badge.svg)](https://github.com/feathershq/pinion/actions/workflows/nodejs.yml)
[![Download Status](https://img.shields.io/npm/dm/@featherscloud/pinion.svg?style=flat-square)](https://www.npmjs.com/package/@featherscloud/pinion)> A fast and typesafe code generator
Pinion is a task runner and scaffolding tool that lets you create code generators for any language. Using TypeScript, it gives you full flexibility over what you can do and provides typesafe templating out-of-the box.
## Quick start
Install Pinion into your project via:
```
npm install @featherscloud/pinion --save-dev
```Then create your first generator file e.g. in `generators/readme.tpl.ts` like this:
```ts
import { PinionContext, toFile, renderTemplate } from '@featherscloud/pinion'// A template for a markdown Readme file
const readme = () => `
# Hello worldThis is a readme generated by Pinion
Copyright (c) ${new Date().getFullYear()}
`export const generate = (init: PinionContext) =>
Promise.resolve(init)
// Render the readme template
.then(renderTemplate(readme, toFile('readme.md')))
```Then run
```
npx pinion generators/readme.tpl.ts
```## Documentation
Head over to the [Pinion documentation](https://feathers.cloud/pinion) for the full documentation.
## License
Copyright (c) 2024 Feathers Cloud Inc.
Licensed under the [MIT license](./LICENSE).