Thanks for your pointer. I think I found my solution on exactly what I want. Here is the code for my requirement. I shared it so that everybody can be benefited.
let myweb = new pnp.Web(encodeURI(siteUrl));
const list = myweb.lists.getByTitle(listTitle);
const includeFields = ['ID', 'Title', 'Modified', 'Modified By', 'Created', 'Created By'];
const filter = `CanBeDeleted eq true or (${includeFields.map(field => `Title eq '${field}'`).join(' or ')})`;
list.fields.select('Id', 'Title', 'InternalName', 'EntityPropertyName', 'CanBeDeleted', 'Hidden', 'ReadOnlyField').
filter(filter).get().then(fields => {
if (fields.length > 0) {
console.log(fields);
}
deferred.resolve(fields);
}).catch(e => {
deferred.reject(e);
});
Here is the output I formatted based on the query:
ID: fa564e0f-0c70-4ab9-b863-0177e6ddd247
Title: Title
Internal Name: Title
ID:88c36055-a6ee-4e1f-8ca2-f57e4f0a9511
Title: FirstName // This is my custom column
Internal Name: FirstName
ID:1d22ea11-1e32-424e-89ab-9fedbadb6ce1
Title: ID
Internal Name: ID
ID:28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f
Title: Modified
Internal Name: Modified
ID:8c06beca-0777-48f7-91c7-6da68bc07b69
Title: Created
Internal Name: Created
ID:1df5e554-ec7e-46a6-901d-d85a3881cb18
Title: Created By
Internal Name: Author
ID:d31655d1-1d5b-4511-95a1-7a09e9b75bf2
Title: Modified By
Internal Name: Editor
ID:173f76c8-aebd-446a-9bc9-769a2bd2c18f
Title: Modified
Internal Name: Last_x0020_Modified
ID:998b5cff-4a35-47a7-92f3-3914aa6aa4a2
Title: Created
Internal Name: Created_x0020_Date
One of the good pointers I found is
https://pnp.github.io/pnpjs/sp/docs/fields/