Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cli-pages is used to easily create pages for your command line interfaces and apps in no time! It has all the features you possibly need! pages can be toggled by using custom words like 'n' or 'next' and 'p' or 'previous' or any other custom word. Custom words for exiting the book can also be set using .setCloseKey()
function available in the 'Book' class.
npm install cli-pages
const { Book } = require("cli-pages");
let pages = new Book([
{
title: "Welcome to my app!",
content: "This app does a lot of stuff! It can help you build a rocket!",
footer: "Hope you enjoy!"
},
{
title: "This is Amazing!",
content: "epic!",
footer: "Hope you understood!"
},
{
title: "Thank you!",
content: "Thank you for using my app! I really appreciate it!",
footer: "<3"
}
]);
let pages = new Book();
pages.addPage({
title: "Welcome to my app!",
content: "This app does a lot of stuff! It can help you build a rocket!",
footer: "Hope you enjoy!"
});
...
const { Book } = require("cli-pages");
let pages = new Book([
{
title: "Welcome to my app!",
content: "This app does a lot of stuff! It can help you build a rocket!",
footer: "Hope you enjoy!"
},
{
title: "This is Amazing!",
content: "epic!",
footer: "Hope you understood!"
},
{
title: "Thank you!",
content: "Thank you for using my app! I really appreciate it!",
footer: "<3"
}
]);
pages.open(); // displays the pages in the terminal
setTimeout(function(){
pages.close(); // ends the page session and stops displaying the code after 60 seconds.
}, 60000)
Pages are created by using the 'Book'
class that is included in this package.
const { Book } = require("cli-pages"); // importing the class from the package
let pages = new Book(); // creating our pages
.addPage()
const { Book } = require("cli-pages");
let pages = new Book([
{
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
}
]);
There is an alternative to the above code! Use the .addPage()
function
Parameters:
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
.removePage()
Parameters:
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.removePage(2); // removes the 2nd page [titled 'sup!']
.editPage()
Parameters:
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.editPage(1, { content: "this is the new content!" }); // edits content of the 1st page
.hasPage()
Parameters:
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.hasPage(2); // returns true
pages.hasPage(6); // returns false
.size()
Parameters: none
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
console.log(pages.size()); // prints 2
.open()
Parameters: none
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.open(); // displays the book in the console
.close()
Parameters: none
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.open(); // displays the book in the console
setTimeout(function(){
pages.close(); // used to close the book. here it closes after 60 seconds of use
}, 60000)
.setCloseKey()
Parameters:
const { Book } = require("cli-pages");
let pages = new Book();
pages.addPage({
title: "hello!",
content: "cli-pages is the best!",
footer: "Thanks!"
});
pages.addPage({
title: "sup!",
content: "cli-pages is the worst!",
footer: "Nope!"
});
pages.setCloseKey("exit"); // 'exit' here will be used to close the book on prompt
For contributing to this project, fork the repository here, make the changes and open a pull request! Pull requests will be reviewed before being merged.
Found a bug? Having an issue with the package? Open a new issue here!
FAQs
pagination for command line apps
The npm package cli-pages receives a total of 0 weekly downloads. As such, cli-pages popularity was classified as not popular.
We found that cli-pages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.