npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-ocaml

v0.1.0

Published

Yeoman generator to scaffold OCaml modules.

Downloads

7

Readme

Table of Contents

This Project

Scaffold OCaml modules?

OCaml is a general purpose programming language with an emphasis on expressiveness and safety which supports both functional, imperative and object-oriented paradigms and features a powerful type system, user-definable algebraic data types and pattern-matching.

This project is Yeoman generator that provides a OCaml project skeleton with the following integrated features:

  • The OASIS build-system
  • The OCamlDoc automatic documentation generation
  • The OUnit testing framework
  • The Bissect code coverage framework

Getting To Know Yeoman

Yeoman is a node.js tool used to scaffold new applications. It can create common project assets like stylesheets and JavaScript files. Basically Yo provides an easy way to create all of the boilerplate code you need to get started on a project.

Feel free to learn more about it here.

Installation

First, make sure you have the main dependencies:

Then install the generator-ocaml.

npm install -g generator-ocaml

Usage

Getting Started

  1. Generate your new project:
yo ocaml

You will be asked the following about your project:

  • What's the package name?
  • What's your package all about?
  • What's the package version?
  • What's your name?
  • What's your email?
  • What's your Github username?
  • Choose your license type (Use arrow keys)

And the you should see the following structure:

|-- lib/
|   |-- myModule.ml/
|-- test/
|   |-- myModule_test.ml
|-- .gitattributes
|-- .gitignore
|-- _oasis
|-- CHANGELOG.md
|-- CONTRIBUTING.md
|-- LICENSE.md
|-- Makefile
|-- README.md
  1. Install the OCaml dependencies:
opam init
opam install oasis ounit bissect
  1. Generate the setup.ml file - which will handle any high-level operation on the project source.
oasis setup
  1. Configure the build-system:
ocaml setup.ml -configure --enable-tests
  1. Build the project:
make

Other Options

To run the test suite, you just have to:

make tests
# Or
ocaml setup.ml -tests

Generating the documentation with OCamlDoc is just the same:

make doc
# Or
ocaml setup.ml -doc

These are the commands you have in setup.ml:

| Command | Description | |-------------------------|------------------------------------------------------------------| | -configure [options*] | Configure the whole build process | | -build [options*] | Build executables and libraries | | -doc [options*] | Build documents | | -test [options*] | Run tests | | -all [options*] | Run configure, build, doc and test targets | | -install [options*] | Install libraries, data, executables and documents | | -uninstall [options*] | Uninstall libraries, data, executables and documents | | -reinstall [options*] | Uninstall and install libraries, data, executables and documents | | -clean [options*] | Clean files generated by a build | | -distclean [options*] | Clean files generated by a build and configure | | -version | Display version of OASIS used to generate this setup.ml | | -no-catch-exn | Don't catch exception, useful for debugging | | -quiet | Run quietly | | -info | Display information message | | -debug | Output debug message | | -ignore-plugins | Ignore plugin's field | | -help, --help | Display this list of options |

Development

All the tasks needed for development automation are defined in the package.json scripts property and can be run via:

npm run <command>

Here is a summary of all the commands:

| Command | Description | |-------------|-----------------------------------------------------------------------------------------| | setup | Installs global Node dependencies needed for development | | lint | Runs ESLint as a code linting utility | | tests | Runs Mocha in BDD mode. | | report | Runs Istanbul coverage reports on Mocha tests | | test | Runs both lint, tests and report commands |

Contributing

Contributions are very welcome! If you'd like to contribute, these guidelines may help you.

History

Check the releases list.

License

generator-ocaml is distributed under the MIT License, available in this repository.

All contributions are assumed to be also licensed under the same.

Credits

The templates codebase was originally inspired by these two projects.