Compare commits

..

No commits in common. "master" and "v1.0.10" have entirely different histories.

8 changed files with 63 additions and 7080 deletions

View File

@ -2,34 +2,17 @@
"gitzone": { "gitzone": {
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "code.foss.global", "githost": "gitlab.com",
"gitscope": "push.rocks", "gitscope": "pushrocks",
"gitrepo": "smartfeed", "gitrepo": "smartfeed",
"shortDescription": "create and parse feeds", "shortDescription": "create and parse feeds",
"npmPackagename": "@push.rocks/smartfeed", "npmPackagename": "@pushrocks/smartfeed",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks", "projectDomain": "push.rocks"
"description": "A library for creating and parsing various feed formats.",
"keywords": [
"RSS",
"Atom",
"feeds creation",
"feeds parsing",
"TypeScript",
"content syndication",
"RSS parser",
"feed generator",
"news feed",
"XML feeds",
"JSON feeds"
]
} }
}, },
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

14
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartfeed", "name": "@pushrocks/smartfeed",
"version": "1.0.11", "version": "1.0.10",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -2284,9 +2284,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
}, },
"@types/node": { "@types/node": {
"version": "14.14.12", "version": "14.14.6",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.12.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.14.6.tgz",
"integrity": "sha512-ASH8OPHMNlkdjrEdmoILmzFfsJICvhBsFfAum4aKZ/9U4B6M6tTmTPh+f3ttWdD74CEGV5XvXWkbyfSdXaTd7g==" "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw=="
}, },
"@types/parcel-bundler": { "@types/parcel-bundler": {
"version": "1.12.1", "version": "1.12.1",
@ -9402,9 +9402,9 @@
} }
}, },
"rss-parser": { "rss-parser": {
"version": "3.10.0", "version": "3.9.0",
"resolved": "https://verdaccio.lossless.one/rss-parser/-/rss-parser-3.10.0.tgz", "resolved": "https://verdaccio.lossless.one/rss-parser/-/rss-parser-3.9.0.tgz",
"integrity": "sha512-TC6FNvEmdFeaW6r/60MSJT7cp4d95X4M9As+mvNtxRx7YXHxpV95syMnWZthZSeD1BRN7SEKdq6c3nxMLQRopw==", "integrity": "sha512-wlRSfGrotOXuWo19Dtl2KmQt7o9i5zzCExUrxpechE0O54BAx7JD+xhWyGumPPqiJj771ndflV3sE3bTHen0HQ==",
"requires": { "requires": {
"entities": "^2.0.3", "entities": "^2.0.3",
"xml2js": "^0.4.19" "xml2js": "^0.4.19"

View File

@ -1,8 +1,8 @@
{ {
"name": "@push.rocks/smartfeed", "name": "@pushrocks/smartfeed",
"version": "1.0.11", "version": "1.0.10",
"private": false, "private": false,
"description": "A library for creating and parsing various feed formats.", "description": "create and parse feeds",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"author": "Lossless GmbH", "author": "Lossless GmbH",
@ -17,14 +17,14 @@
"@gitzone/tstest": "^1.0.44", "@gitzone/tstest": "^1.0.44",
"@pushrocks/smartfile": "^8.0.8", "@pushrocks/smartfile": "^8.0.8",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.14.12", "@types/node": "^14.14.6",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@tsclass/tsclass": "^3.0.29", "@tsclass/tsclass": "^3.0.29",
"feed": "^4.2.1", "feed": "^4.2.1",
"rss-parser": "^3.10.0" "rss-parser": "^3.9.0"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@ -40,23 +40,5 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
], ]
"keywords": [
"RSS",
"Atom",
"feeds creation",
"feeds parsing",
"TypeScript",
"content syndication",
"RSS parser",
"feed generator",
"news feed",
"XML feeds",
"JSON feeds"
],
"homepage": "https://code.foss.global/push.rocks/smartfeed",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartfeed.git"
}
} }

6917
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@

123
readme.md
View File

@ -1,106 +1,39 @@
# @push.rocks/smartfeed # @pushrocks/smartfeed
create and parse feeds create and parse feeds
## Install ## Availabililty and Links
To install `@push.rocks/smartfeed`, you need to have Node.js installed on your machine. After setting up Node.js, run the following command in your terminal: * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartfeed)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartfeed)
* [github.com (source mirror)](https://github.com/pushrocks/smartfeed)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartfeed/)
```bash ## Status for master
npm install @push.rocks/smartfeed --save
``` Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartfeed/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartfeed/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartfeed)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartfeed)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartfeed)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartfeed)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartfeed)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
`@push.rocks/smartfeed` is a powerful library for creating and parsing RSS and Atom feeds with ease. It leverages TypeScript for type safety and improved developer experience. Let's explore how you can utilize this library in your projects.
### Creating Feeds Use TypeScript for best in class intellisense
You can create feeds by instantiating a `Smartfeed` object and configuring feed options and items. Heres an example of how to create an RSS feed:
```typescript ## Contribution
import { Smartfeed, IFeedOptions, IFeedItem } from '@push.rocks/smartfeed';
// Create a new Smartfeed instance We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
const mySmartfeed = new Smartfeed();
// Define feed options For further information read the linked docs at the top of this readme.
const feedOptions: IFeedOptions = {
domain: 'example.com',
title: 'Example News',
description: 'Latest news from Example',
category: 'News',
company: 'Example Company',
companyEmail: 'contact@example.com',
companyDomain: 'https://example.com',
};
// Create a new feed with options > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
const myFeed = mySmartfeed.createFeed(feedOptions); | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
// Add items to the feed [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
const feedItem: IFeedItem = {
title: 'Breaking News: TypeScript Adoption Soars!',
timestamp: Date.now(), // Use current timestamp
url: 'https://example.com/news/typescript-adoption',
authorName: 'Jane Doe',
imageUrl: 'https://example.com/images/typescript-news.jpg',
content: 'In a recent survey, TypeScript has seen a significant increase in adoption among developers...',
};
// Add the item to the feed
myFeed.addItem(feedItem);
// Export the feed as an RSS string
const rssFeedString = myFeed.exportRssFeedString();
console.log(rssFeedString);
```
This code snippet creates an RSS feed for a news article. You can customize the `IFeedOptions` and `IFeedItem` objects to match your content.
### Parsing Feeds
`@push.rocks/smartfeed` also allows parsing of RSS and Atom feeds from a string or URL. Heres how you can parse a feed:
```typescript
import { Smartfeed } from '@push.rocks/smartfeed';
// Create a new Smartfeed instance
const mySmartfeed = new Smartfeed();
// Parsing a feed from a string
const rssString = `your RSS feed string here`;
mySmartfeed.parseFeedFromString(rssString).then(feed => {
console.log(feed);
});
// Parsing a feed from a URL
const feedUrl = 'https://example.com/rss';
mySmartfeed.parseFeedFromUrl(feedUrl).then(feed => {
console.log(feed);
});
```
This example demonstrates how to parse an RSS feed from a given string or URL. The `parseFeedFromString` and `parseFeedFromUrl` methods return a Promise that resolves to the parsed feed object.
### Comprehensive Feed Management
With `@push.rocks/smartfeed`, you have full control over creating and managing feeds. Beyond basic scenarios shown above, you can create feeds from arrays of articles, customize feed and item properties extensively, and export feeds in different formats (RSS, Atom, JSON).
For instance, to create a feed from an array of article objects conforming to `@tsclass/tsclass`'s `IArticle` interface, you can use the `createFeedFromArticleArray` method. Additionally, explore different export options available on the `Feed` class to suit your needs, whether it's RSS 2.0, Atom 1.0, or JSON Feed 1.0.
Remember, `@push.rocks/smartfeed` is designed to streamline feed creation and parsing with a focus on type safety and developer experience. Explore its comprehensive API to leverage the full potential of feed management in your applications.
For complete usage and all available methods, refer to the TypeScript declarations and source code available in the package. Happy coding!
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

17
tslint.json Normal file
View File

@ -0,0 +1,17 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}