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

@greenjd/simple-odf

v2.0.2

Published

Open Document Format made easy using pure JavaScript and Node.js

Downloads

6

Readme

simple-odf

simple-odf is a library for creating Open Document Format text files using Typescript/JavaScript and Node.js.

Version Continuous Integration codecov Dependencies Known Vulnerabilities semantic-release code style: prettier

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See usage for notes on how to integrate the project in your software.

Prerequisites

To get started locally, follow these instructions:

  1. Make sure that you have Node 12.x or later installed (Changed by Greenfire.io). See instructions here.

  2. Make sure that you have yarn installed; see instructions here.

  3. simple-odf uses npm for running development scripts. If you haven't already done so, please install npm.

Installing

  1. Make a fork of this repo.

  2. Clone the forked repo to your local computer using git.

    Open terminal and type:

    git clone https://github.com/<your_username>/simple-odf
  3. Run npm install from the root of your clone of this project to install dependencies.

    # navigate into the cloned repo
    cd simple-odf
    # install the dependencies
    npm install

Building the Module

To make a local build run:

npm build
npm pack

This generates a number of javascript files in the dist/ directory and a simple-odf-<version-number>.tgz file in the project root.

To actually use the locally built lib, switch to another repository reproducing the specific issue you want to fix (or just generate a local repo). Then install the locally built package:

cd <path-to-your-other-repo>
npm install <path-to-the-simple-odf-repo>/*.tgz

Testing

There are two different kind of tests which can be run locally:

Unit Tests

Each class of project should be tested isolated which is done by the unit tests. To run them, just execute npm test.

Integration Tests

There are also some tests which verify that the resulting document is correct. These cannot be run yet.

When debugging a specific test, change describe() or it() to fdescribe() and fit() to focus execution to just that one test. This will keep the output clean and speed up execution by not running irrelevant tests.

Usage

If you want to use this package in your software, add it to your project dependencies via npm or yarn.

# npm
npm i simple-odf
# yarn
yarn add simple-odf

Now you can create your first document.

const simpleOdf = require('simple-odf');

const document = new simpleOdf.TextDocument();
const body = document.getBody();

body.addHeading('Welcome to simple-odf');
body.addParagraph('The quick, brown fox jumps over a lazy dog.');

document.saveFlat('/home/homer/Welcome.fodf');

See the examples for more details on how to use the library.

Built With

  • xmldom - Used to serialize the XML

Contributing

If you want to contribute to simple-odf, you are very welcome. Send issues and pull requests with your ideas.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Credits

This project exists thanks to all the contributors who participate in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Learn more about the OASIS Open Document Format.