Comparing version 0.0.1 to 0.0.2
'use strict'; | ||
const fs = require('fs-extra'); | ||
const {readJsonSync: readFileSync} = require('node-serialization'); | ||
const {urlAlias} = require('feed-db/lib/utils.js'); | ||
const { readJsonSync: readFileSync } = require('node-serialization'); | ||
const { urlAlias } = require('./utils.js'); | ||
@@ -20,3 +20,3 @@ class Feeds { | ||
this.DB = {}; | ||
feedList.forEach(feed => { | ||
feedList.forEach((feed) => { | ||
if (feed && feed.alias) { | ||
@@ -23,0 +23,0 @@ this.DB[feed.alias] = feed; |
'use strict'; | ||
const Feeds = require('feed-db/lib/feeds.js'); | ||
const {urlAlias} = require('feed-db/lib/utils.js'); | ||
const Feeds = require('./feeds.js'); | ||
const { urlAlias } = require('./utils.js'); | ||
module.exports = {Feeds, urlAlias}; | ||
module.exports = { Feeds, urlAlias }; |
'use strict'; | ||
const urlAlias = url => { | ||
const urlAlias = (url) => { | ||
const regex = /https?:\/\/|www\.|\?.+|#.+|index\.html|\/$/g; | ||
@@ -5,0 +5,0 @@ url = url.replace(regex, ''); |
{ | ||
"name": "feed-db", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Feed database read APIs.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"lint": "xo", | ||
"lint:fix": "xo --fix", | ||
"lint": "prettier --write . && xo", | ||
"lint:fix": "prettier --write . && xo --fix", | ||
"test": "mocha test/index.js", | ||
@@ -14,4 +14,4 @@ "test:cov": "nyc npm run test", | ||
"dependencies": { | ||
"fs-extra": "^8.1.0", | ||
"node-serialization": "^1.0.0" | ||
"fs-extra": "^9.0.1", | ||
"node-serialization": "^1.0.1" | ||
}, | ||
@@ -21,6 +21,6 @@ "devDependencies": { | ||
"chai-as-promised": "^7.1.1", | ||
"mocha": "^6.2.1", | ||
"feed-db": "file:.", | ||
"nyc": "^14.1.1", | ||
"xo": "^0.25.3" | ||
"mocha": "^8.1.1", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.0.5", | ||
"xo": "^0.32.1" | ||
}, | ||
@@ -53,2 +53,3 @@ "keywords": [ | ||
"space": 2, | ||
"prettier": true, | ||
"rules": { | ||
@@ -55,0 +56,0 @@ "promise/prefer-await-to-then": 0, |
@@ -6,4 +6,3 @@ # feed-db | ||
[![Build Status][travis-image]][travis-url] | ||
[![dependencies Status][dependencies-image]][dependencies-url] | ||
[![devDependencies Status][devDependencies-image]][devDependencies-url] | ||
[![code style: prettier][code-style-prettier-image]][code-style-prettier-url] | ||
@@ -19,17 +18,30 @@ Feed database read APIs. | ||
## Usages | ||
### Feeds | ||
```js | ||
foo(bar); | ||
const { Feeds } = require("feed-db"); | ||
const feeds = new Feeds("feed-db.json"); | ||
console.log(feeds.getFeed("https://myblog.com")); | ||
console.log(feeds.getFeed("https://www.myblog.com")); | ||
console.log(feeds.getFeed("myblog.com")); | ||
``` | ||
## Related | ||
- [dev-blog-directory](https://github.com/dev-blog-directory/dev-blog-directory) - A Developer Blog Directory. Auto generated documents from [raw data](https://github.com/dev-blog-directory/dev-blog-directory-raw). | ||
- [dev-blog-directory-raw](https://github.com/dailyrandomphoto/dev-blog-directory-raw) - Raw data storage of [Developer Blog Directory](https://github.com/dailyrandomphoto/dev-blog-directory). | ||
- [dev-blog-directory-feed-db](https://github.com/dev-blog-directory/dev-blog-directory-feed-db) - Feed database of developer blogs. | ||
## License | ||
Copyright (c) 2019 [dailyrandomphoto][my-url]. Licensed under the [MIT license][license-url]. | ||
Copyright (c) 2020 [dailyrandomphoto][my-url]. Licensed under the [MIT license][license-url]. | ||
[my-url]: https://github.com/dailyrandomphoto | ||
[npm-url]: https://www.npmjs.com/package/feed-db | ||
[travis-url]: https://travis-ci.org/dailyrandomphoto/feed-db | ||
[coveralls-url]: https://coveralls.io/github/dailyrandomphoto/feed-db?branch=master | ||
[license-url]: LICENSE | ||
[dependencies-url]: https://david-dm.org/dailyrandomphoto/feed-db | ||
[devDependencies-url]: https://david-dm.org/dailyrandomphoto/feed-db?type=dev | ||
[code-style-prettier-url]: https://github.com/prettier/prettier | ||
[npm-downloads-image]: https://img.shields.io/npm/dm/feed-db | ||
@@ -39,4 +51,2 @@ [npm-version-image]: https://img.shields.io/npm/v/feed-db | ||
[travis-image]: https://img.shields.io/travis/dailyrandomphoto/feed-db | ||
[coveralls-image]: https://img.shields.io/coveralls/github/dailyrandomphoto/feed-db | ||
[dependencies-image]: https://img.shields.io/david/dailyrandomphoto/feed-db | ||
[devDependencies-image]: https://img.shields.io/david/dev/dailyrandomphoto/feed-db | ||
[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5333
50
+ Addedat-least-node@1.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
Updatedfs-extra@^9.0.1
Updatednode-serialization@^1.0.1