https://github.com/facile-it/fortepiano
Playing actual music over fp-ts notes
https://github.com/facile-it/fortepiano
fp-ts functional-programming io-ts typescript
Last synced: 3 months ago
JSON representation
Playing actual music over fp-ts notes
- Host: GitHub
- URL: https://github.com/facile-it/fortepiano
- Owner: facile-it
- License: mit
- Created: 2021-05-06T16:24:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-19T10:20:08.000Z (5 months ago)
- Last Synced: 2025-07-02T04:50:50.884Z (3 months ago)
- Topics: fp-ts, functional-programming, io-ts, typescript
- Language: TypeScript
- Homepage:
- Size: 3.52 MB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
![]()
# fortepiano [ˌfɔrteˈpjaːno]
_Playing actual music over `fp-ts` notes_ 🎶
[](https://github.com/facile-it/fortepiano/actions)
[](https://app.codecov.io/gh/facile-it/fortepiano)
[](LICENSE.md)
[](https://www.npmjs.com/package/fortepiano)## Description
Fortepiano is a mocking library for TypeScript. It promotes immutability, composability and purity, making it ideal for projects that embrace functional programming principles.
## Getting Started
### Installation
To install the stable version:
```bash
npm install fortepiano
```or using yarn:
```bash
yarn add fortepiano
```### Usage
Fortepiano uses a functional API to create and configure mocks, encouraging pure function usage and immutable mock objects.
Here's an example:
```typescript
import { $mock } from 'fortepiano'interface User {
firstName: string
lastName: string
}export const UserMock = (): $mock.Mock =>
$mock.struct({
firstName: $mock.string,
lastName: $mock.string,
})console.log(UserMock()()()) // Output: { firstName: 'randomString', lastName: 'randomString' }
```## Contributing
See the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.
## Authors
- [Davide Caruso](https://github.com/davidecaruso)
- [Pier Roberto Lucisano](https://github.com/pierroberto)
- [Alberto Villa](https://github.com/xzhayon)## License
This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.