Skip to content

Releases: LebCit/litenode

v3.3.1

20 Jul 06:37

Choose a tag to compare

Fix

Enhanced Condition Evaluation

Details

This patch enhances the condition evaluation functionality to support all logical and comparison operators, ensuring robust and comprehensive condition handling in templates.

Changes

  1. Enhance condition evaluation to support all logical and comparison operators
    • Updated evaluateCondition to handle logical operators (&&, ||) and comparison operators (==, !=, >=, <=, <, >).
    • Ensured evaluateSimpleExpression correctly evaluates both logical and comparison expressions.

v3.3.0

19 Jul 20:52

Choose a tag to compare

New Features

  • Enhanced resolveValue to support nested properties with dot notation.
  • Updated evaluateCondition to handle logical operators and simple conditions.
  • Refactored evaluateSimpleExpression and evaluateComparison for accurate condition evaluations.
  • Added fileBaseName property to parseFrontmatter return object.

Details

This release introduces several improvements and new features to enhance the functionality and flexibility of the template engine and frontmatter parsing.

Changes

  1. Enhance resolveValue to support nested properties with dot notation

    • Updated the resolveValue function to handle nested keys using dot notation.
    • Ensured proper value resolution from data objects for nested properties.
  2. Update evaluateCondition to handle logical operators and simple conditions

    • Modified evaluateCondition to distinguish between logical expressions and simple truthy checks.
    • Integrated resolveValue for simple condition evaluations.
  3. Refactor evaluateSimpleExpression and evaluateComparison for accurate condition evaluations

    • Enhanced evaluateSimpleExpression to evaluate conditions with logical operators.
    • Updated evaluateComparison to perform comparisons using resolved values.
    • Ensured consistent and correct evaluation of expressions.
  4. Add fileBaseName property to parseFrontmatter return object

    • Added fileBaseName to the returned object from the parseFrontmatter function.
    • This property contains the base name of the file without its extension.

This release brings significant enhancements to the way nested properties and logical conditions expressions are evaluated in the template engine (see docs), as well as improvements to the frontmatter parsing functionality. As always, your feedback and contributions are most welcome. Thank you for using LiteNode!

v3.2.0

17 Jul 21:35

Choose a tag to compare

New Feature

Enhanced Body Parsing Support

Details

I'm excited to announce the release of version 3.2.0 of LiteNode, which includes a significant enhancement to the request body parsing capabilities. This update adds support for parsing application/x-www-form-urlencoded content types in addition to the existing application/json support. This improvement allows for greater flexibility and ease of handling different types of data in POST requests.

Changes

  • Integrated Body Parser:

    • The jsonHandler function has been enhanced to support application/x-www-form-urlencoded content types, making it easier to handle form data.
    • The framework now correctly parses URL-encoded form data and assigns nested properties within the parsed object.
  • Updated Documentation:

    • The description for the integrated body parser has been updated to reflect the new functionality, supporting both application/json and application/x-www-form-urlencoded content types.
    • Documentation links have been updated accordingly to guide users on how to utilize the enhanced body parser.
  • Reminder - Automated Version Check:

    • Since the previous version, LiteNode automatically checks for and notifies you if a new version is available whenever the server starts, ensuring you stay up-to-date with the latest features and improvements.

I hope these enhancements improve your experience with LiteNode and make it even easier to build robust and flexible web applications. As always, your feedback and contributions are most welcome. Thank you for using LiteNode!

v3.1.0

13 Jul 23:40

Choose a tag to compare

New Features

  • Add method for sending HTML responses
  • Add method for sending XML responses
  • Add a check for LiteNode's update on server start

Details

While STE can effectively render HTML templates, it is a Simple Template Engine suitable for straightforward HTML architectures where the transferred data doesn't need complex manipulation. Therefore, LiteNode provides an html method extending the response object, enabling users to employ another template engine with LiteNode.

The xml method is particularly useful for API endpoints or responses where XML is the desired format, such as RSS feeds and sitemaps.

"The startServer method now includes an update verification feature."

Changes

  • feat: add update check with internet connectivity verification to startServer method
  • feat: enhance startServer method to await update check and return server instance
  • feat(response): add method for sending HTML responses
  • feat(response): add method for sending XML responses
  • feat(types): add TypeScript definition for html method
  • feat(types): add TypeScript definition for xml method
  • refactor: Improve clarity and efficiency of frontmatter validation
  • refactor(STE): enhance template rendering with replacePlaceholders method
  • refactor(processEach): improve placeholder resolution and recursive processing
  • docs(paginator): add JSDoc comments and enhance pagination logic
  • chore(release): bump version to 3.1.0

v3.0.0

05 Jul 21:32

Choose a tag to compare

Details

In LiteNode v3.0.0, I've undertaken a complete ground-up rewrite to enhance modularity and maintainability. This major update reorganizes the core structure by breaking down functionalities into individual modules, allowing for cleaner code and easier management. By separating internal methods and classes into dedicated files, I've significantly improved code readability and extensibility, paving the way for future enhancements and smoother integrations. This release marks a pivotal step in LiteNode's evolution, offering a more robust and scalable framework for your projects.

BREAKING CHANGE: As of version 3.0.0, LiteNode no longer supports being loaded using require. This change aims to maintain and enhance LiteNode in a modular way, which would be difficult to achieve if backward compatibility with CommonJS were maintained.

Changes

  • Put LiteNode's declaration in a "types" directory
  • Create utility functions in "utils" folder within "core" directory
  • Refactor preprocessConditionals: split into multiple files
  • Refactor: Separate readFileContent and handleIncludes into individual files
  • Refactor: Modularize STE class by importing functions from separate files
  • Refactor: Break down SMP class functions into separate files
  • Refactor: Modularize SMP class by importing functions from separate files
  • Refactor: Separate Markdown helper functions into individual files
  • Refactor: Separate LiteNode's private methods into individual files
  • Refactor: Separate RouteNode and StaticAssetLoader classes into individual files
  • Refactor: Modularize LiteNode class by importing functions from separate files
  • Docs: Update README with breaking change note and remove incompatible code
  • Chore: Bump version to 3.0.0 and update package.json configuration

v2.1.1

02 Jul 21:55

Choose a tag to compare

Changes

v2.1.0

26 Jun 13:51

Choose a tag to compare

New Feature

Add support for nested each blocks and dot notation.

Details

The {{#each}} directive can now access the object's properties using dot notation. Nested loops can be handled by incrementing the each number.

Changes

  • Enhanced each loop functionality to handle nested eachN blocks automatically.
  • Implemented support for dot notation to access nested object properties within each loops.
  • Updated documentation to reflect new features and usage examples.
  • Bumped version from 2.0.0 to 2.1.0.

v2.0.0

19 Jun 11:53

Choose a tag to compare

New Features

  • Added full JSDoc in litenode.d.ts for each and every method
  • Rendering templates is now asynchronous
  • addIdsToHeadings has been integrated into SMP (Simple Markdown Parser)
  • extractMarkdownProperties is now asynchronous and supports an array, a folder or a file as an input
  • Added new methods: groupByMarkdownProperty, paginateMarkdownFiles and generateTOC

Details

A detailed documentation of these new capabilities, is available in the new version of LiteNode's documentation.

  • If you use an IDE that supports autocomplete, you'll see a brief description and example when using LiteNode's methods as well as a link to the method's documentation.
  • Rendering templates has been updated to be asynchronous.
  • IDs for heading tags in Markdown, addIdsToHeadings, has been fully integrated into SMP. Now you can just write {# my-id} and LiteNode will take care of it for you!
  • Properties can now be extracted from a single file, from multiple files in the same directory or from an array of files.
  • groupByMarkdownProperty helps in categorizing or organizing markdown files based on a specific frontmatter field.
  • paginateMarkdownFiles helps in displaying markdown files in a paginated format, useful for creating blogs or documentations.
  • generateTOC helps in creating a TOC for better navigation within documents.

Changes

  • Add JSDoc for all methods
  • Make rendering asynchronous
  • Ingrate addIdsToHeadings into SMP. Ensure Markdown heading tags in code's blocks are not parsed to HTML.
  • Make extractMarkdownProperties async. Input can be array, folder or file.
  • Add groupByMarkdownProperty method.
  • Add paginateMarkdownFiles method.
  • Add generateTOC method.
  • Bump LiteNode to major version and publish.

v1.4.0

13 Jun 20:04

Choose a tag to compare

New Feature

Added Simple Markdown Parser (SMP) to LiteNode 🔥

Details

Inspired by Blog-Doc, the process of parsing Markdown files has been enhanced and integrated into LiteNode.
LiteNode's Markdown handling capabilities allow for flexible and powerful parsing, rendering, and serving of Markdown content. Whether you need to parse individual files, multiple files from a directory, extract specific properties from the frontmatter or add IDs to headings, LiteNode provides the tools necessary to efficiently manage and utilize Markdown content in your applications.
A detailed documentation of these new capabilities, along with simple examples are available in the Markdown section of LiteNode's documentation.

Changes

  • Add SMP (Simple Markdown Parser)
  • Load SMP into LiteNode.
  • Add methods based on SMP to LiteNode.
  • Add new methods definitions to LiteNode's declaration file.
  • Update README
  • Bump LiteNode version and publish.

v1.3.0

11 Jun 05:01

Choose a tag to compare

New Feature

The Simple Template Engine (STE) has been enhanced with several powerful features to provide more flexibility and control over template rendering. These new features include advanced conditional logic, looping through arrays, and the ability to negate conditions.

Details

A detailed documentation of these new capabilities, along with simple examples are available in STE Helpers of LiteNode's documentation.

Changes

  • Add conditionals and arrays helpers to STE
  • Add links to Key Features section in README
  • Bump LiteNode version and publish package